mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-29 13:28:10 +00:00
Avoid invalid read when minval > maxval
This commit is contained in:
parent
271ead2fd3
commit
aa99594575
@ -173,8 +173,12 @@ done:
|
|||||||
*errstrp = N_("value too large");
|
*errstrp = N_("value too large");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (endp != NULL)
|
if (endp != NULL) {
|
||||||
*endp = (char *)(errval == STN_INITIAL ? str : cp - 1);
|
if (errval == STN_INITIAL || errval == STN_INVALID)
|
||||||
|
*endp = (char *)str;
|
||||||
|
else
|
||||||
|
*endp = (char *)(cp - 1);
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user