2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 14:25:15 +00:00

If realloc of sudoerslval.command.args fails, reset sudoerslval.command.args

as well as arg_len and arg_size after freeing sudoerslval.command.args.
This commit is contained in:
Todd C. Miller
2016-01-29 11:10:36 -07:00
parent a7e5ae1e5b
commit 2224cfd000

View File

@@ -147,6 +147,8 @@ fill_args(const char *s, size_t len, int addspace)
sudo_warnx(U_("%s: %s"), __func__, U_("unable to allocate memory"));
sudoerserror(NULL);
free(sudoerslval.command.args);
sudoerslval.command.args = NULL;
arg_len = arg_size = 0;
debug_return_bool(false);
} else
sudoerslval.command.args = p;