]> granicus.if.org Git - sudo/commitdiff
fixed dereferencing deadbeef
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 2 Feb 1996 06:14:20 +0000 (06:14 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 2 Feb 1996 06:14:20 +0000 (06:14 +0000)
parse.yacc

index e238d1f24092536f2c3f7064d362af76b24d2787..571741afa7f1bc4b1e080d3a23684c7d0314ff78 100644 (file)
@@ -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++)