]> granicus.if.org Git - sudo/commitdiff
Avoid using pre or post increment in a parameter to a ctype(3)
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 31 Mar 2011 16:48:01 +0000 (12:48 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 31 Mar 2011 16:48:01 +0000 (12:48 -0400)
function as it might be a macro that causes the increment to happen
more than once.

plugins/sudoers/toke.c
plugins/sudoers/toke.l

index 2aeb0f84e238dba4bdbbb787ffc56dcc60add38d..22992bf32075e6213f5db3e3abde7d066d58651d 100644 (file)
@@ -1992,9 +1992,9 @@ YY_RULE_SETUP
                            for (n = 0; isblank((unsigned char)yytext[n]); n++)
                                continue;
                            n += sizeof("Defaults") - 1;
-                           if ((deftype = yytext[n]) != '\0') {
-                               while (isblank((unsigned char)yytext[++n]))
-                                   continue;
+                           if ((deftype = yytext[n++]) != '\0') {
+                               while (isblank((unsigned char)yytext[n]))
+                                   n++;
                            }
                            BEGIN GOTDEFS;
                            switch (deftype) {
index d70b1c30d5d031e826090d25e14c9c2869aa5b1c..9e1cdc12da0f066c6cda27697d6b433d39ede130 100644 (file)
@@ -302,9 +302,9 @@ DEFVAR                      [a-z_]+
                            for (n = 0; isblank((unsigned char)yytext[n]); n++)
                                continue;
                            n += sizeof("Defaults") - 1;
-                           if ((deftype = yytext[n]) != '\0') {
-                               while (isblank((unsigned char)yytext[++n]))
-                                   continue;
+                           if ((deftype = yytext[n++]) != '\0') {
+                               while (isblank((unsigned char)yytext[n]))
+                                   n++;
                            }
                            BEGIN GOTDEFS;
                            switch (deftype) {