2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-30 05:48:18 +00:00

Fix underflow checl in fill_args().

This commit is contained in:
Todd C. Miller 2016-07-16 20:54:07 -06:00
parent 88ba54f478
commit 73b0ac4bc1

View File

@ -153,7 +153,8 @@ fill_args(const char *s, size_t len, int addspace)
p = sudoerslval.command.args + arg_len;
if (addspace)
*p++ = ' ';
if (strlcpy(p, s, arg_size - (p - sudoerslval.command.args)) != (size_t)len) {
len = arg_size - (p - sudoerslval.command.args);
if (strlcpy(p, s, len) != len) {
sudo_warnx(U_("internal error, %s overflow"), __func__);
goto bad;
}