You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Dean Gaudet <dg...@arctic.org> on 1997/09/25 02:28:58 UTC

[PATCH] mod_include/1139: parse_expr() evaluates some expressions containing && or || incorrectly

The following patch against 1.3 fixes PR#1139.  There's a fix for 1.2.5 in
the bugdb already which is the same except for formatting.  Please vote on
this for both 1.3 and 1.2.5. 

The code which evaluates the left and right trees of && and || doesn't set
the value in the tree ... so you get bogus results using uninitialized
data. 

Dean

Index: mod_include.c
===================================================================
RCS file: /export/home/cvs/apachen/src/modules/standard/mod_include.c,v
retrieving revision 1.54
diff -u -r1.54 mod_include.c
--- mod_include.c	1997/09/19 17:25:10	1.54
+++ mod_include.c	1997/09/25 00:25:59
@@ -1569,6 +1569,7 @@
                     strncpy(current->left->token.value, buffer,
                             MAX_STRING_LEN - 1);
                     current->left->token.value[MAX_STRING_LEN - 1] = '\0';
+		    current->left->value = (current->left->token.value[0] != '\0');
                     current->left->done = 1;
                     break;
                 default:
@@ -1584,6 +1585,7 @@
                     strncpy(current->right->token.value, buffer,
                             MAX_STRING_LEN - 1);
                     current->right->token.value[MAX_STRING_LEN - 1] = '\0';
+		    current->right->value = (current->right->token.value[0] != '\0');
                     current->right->done = 1;
                     break;
                 default: