]> granicus.if.org Git - sudo/commitdiff
Use yy_size_t for digest_len since newer flex uses yy_size_t for
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 22 Nov 2015 16:19:12 +0000 (09:19 -0700)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 22 Nov 2015 16:19:12 +0000 (09:19 -0700)
yyleng.  Old flex uses int for yyleng so we need to use a cast to
avoid a sign compare warning.

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

index 9a1acc864d77aca354856e7311aa621a777b24f3..4cd0393e4e63717fa50a2f95137faec87155fb64 100644 (file)
@@ -2014,7 +2014,7 @@ gid_t sudoers_gid = SUDOERS_GID;
 
 static bool continued, sawspace;
 static int prev_state;
-static int digest_len;
+static yy_size_t digest_len;
 
 static bool push_include_int(char *, bool);
 static bool pop_include(void);
@@ -2476,7 +2476,7 @@ YY_RULE_SETUP
 #line 256 "toke.l"
 {
                            /* Only return DIGEST if the length is correct. */
-                           if (sudoersleng == digest_len * 2) {
+                           if ((yy_size_t)sudoersleng == digest_len * 2) {
                                if (!fill(sudoerstext, sudoersleng))
                                    yyterminate();
                                BEGIN INITIAL;
@@ -2492,7 +2492,7 @@ YY_RULE_SETUP
 #line 269 "toke.l"
 {
                            /* Only return DIGEST if the length is correct. */
-                           int len;
+                           yy_size_t len;
                            if (sudoerstext[sudoersleng - 1] == '=') {
                                /* use padding */
                                len = 4 * ((digest_len + 2) / 3);
@@ -2500,7 +2500,7 @@ YY_RULE_SETUP
                                /* no padding */
                                len = (4 * digest_len + 2) / 3;
                            }
-                           if (sudoersleng == len) {
+                           if ((yy_size_t)sudoersleng == len) {
                                if (!fill(sudoerstext, sudoersleng))
                                    yyterminate();
                                BEGIN INITIAL;
index 000660a86b912763ffbf1efa0b8664b84af30892..ca910f245161df5cbe964831134c4159eb3ba85a 100644 (file)
@@ -74,7 +74,7 @@ gid_t sudoers_gid = SUDOERS_GID;
 
 static bool continued, sawspace;
 static int prev_state;
-static int digest_len;
+static yy_size_t digest_len;
 
 static bool push_include_int(char *, bool);
 static bool pop_include(void);
@@ -255,7 +255,7 @@ DEFVAR                      [a-z_]+
 
 <WANTDIGEST>[[:xdigit:]]+ {
                            /* Only return DIGEST if the length is correct. */
-                           if (sudoersleng == digest_len * 2) {
+                           if ((yy_size_t)sudoersleng == digest_len * 2) {
                                if (!fill(sudoerstext, sudoersleng))
                                    yyterminate();
                                BEGIN INITIAL;
@@ -268,7 +268,7 @@ DEFVAR                      [a-z_]+
 
 <WANTDIGEST>[A-Za-z0-9\+/=]+ {
                            /* Only return DIGEST if the length is correct. */
-                           int len;
+                           yy_size_t len;
                            if (sudoerstext[sudoersleng - 1] == '=') {
                                /* use padding */
                                len = 4 * ((digest_len + 2) / 3);
@@ -276,7 +276,7 @@ DEFVAR                      [a-z_]+
                                /* no padding */
                                len = (4 * digest_len + 2) / 3;
                            }
-                           if (sudoersleng == len) {
+                           if ((yy_size_t)sudoersleng == len) {
                                if (!fill(sudoerstext, sudoersleng))
                                    yyterminate();
                                BEGIN INITIAL;