From: Todd C. Miller Date: Fri, 29 Jan 2016 18:10:36 +0000 (-0700) Subject: If realloc of sudoerslval.command.args fails, reset sudoerslval.command.args X-Git-Tag: SUDO_1_8_16^2~25 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2224cfd00004207a96a65ccadd94ec19b94dfa70;p=sudo If realloc of sudoerslval.command.args fails, reset sudoerslval.command.args as well as arg_len and arg_size after freeing sudoerslval.command.args. --- diff --git a/plugins/sudoers/toke_util.c b/plugins/sudoers/toke_util.c index 977028ba8..a8989459a 100644 --- a/plugins/sudoers/toke_util.c +++ b/plugins/sudoers/toke_util.c @@ -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;