fix: V-001 security vulnerability

Automated security fix generated by OrbisAI Security
This commit is contained in:
orbisai0security 2026-06-28 00:29:35 +00:00
parent db15a39d75
commit 17488da0da

View file

@ -1920,10 +1920,10 @@ ctl_writeonly(void *oldp, size_t *oldlenp) {
static inline int
ctl_assured_write(void *dst, size_t dst_size, const void *newp,
size_t newlen) {
if (newp == NULL || newlen != dst_size) {
if (newp == NULL || newlen > dst_size) {
return EINVAL;
}
memcpy(dst, newp, dst_size);
memcpy(dst, newp, newlen);
return 0;
}