www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Slesinsky <bsles...@wired.com>
Subject mod_include/1139: parse_expr() evaluates some expressions containing && or || incorrectly
Date Wed, 17 Sep 1997 02:10:03 GMT

>Number:         1139
>Category:       mod_include
>Synopsis:       parse_expr()  evaluates some expressions containing && or || incorrectly
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apache (Apache HTTP Project)
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Tue Sep 16 19:10:01 1997
>Originator:     bslesins@wired.com
>Release:        1.2.0, 1.2.4
Apache 1.2.0 running on Linux 2.0.30
Expressions such as "$x && $y" actually return a random value depending on
previous contents of memory.  A workaround is to put parentheses around the
variables:  "($x) && ($y)".

I found the problem in 1.2.0 but from reading the code it looks like it's still
there in 1.2.4.
(The first #if is irrelevant but if it's deleted the bug
stops working in my system.  Also, whether the bug occurs is
very system-specific)

<!--#if expr="($XXXXXXXXXXXXXx = /MSIE [3-9].*Win/) || ($HTTP_USER_AGENT = /Mozi
<!--#endif -->
<!--#if expr="((!$form_NUMMOD) && ${form_morekeywords.x}) || (($form_NUMMOD) &
& !(($form_NUMMOD=0) || ($form_NUMMOD=1) || ($form_NUMMOD=2)))" -->
If you can see this there's a bug.
<!--#endif -->
It appears to be because the code to evaluate strings in lines 1327-1357 of
mod_include.c never sets current->left->value or current->right->value.
Perhaps replacing the switch() statements with the default case (so strings are
always evaluated in the same place) would fix the problem.

View raw message