From: Todd C. Miller Date: Fri, 2 Feb 1996 06:14:20 +0000 (+0000) Subject: fixed dereferencing deadbeef X-Git-Tag: SUDO_1_5_0~298 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=65058a1006b9559eb92589e4f29a035bcccd2f34;p=sudo fixed dereferencing deadbeef --- diff --git a/parse.yacc b/parse.yacc index e238d1f24..571741afa 100644 --- a/parse.yacc +++ b/parse.yacc @@ -267,8 +267,15 @@ cmnd : ALL { | COMMAND { char **t; - if (path_matches(cmnd, &NewArgv[1], $1.cmnd, $1.args)) - cmnd_matches = TRUE; + /* XXX - use '?' operator */ + if (NewArgc > 1) { + if (path_matches(cmnd, &NewArgv[1], $1.cmnd, + $1.args)) + cmnd_matches = TRUE; + else if (path_matches(cmnd, NULL, $1.cmnd, + $1.args)) + cmnd_matches = TRUE; + } (void) free($1.cmnd); for (t = $1.args; t && *t; t++)