iliaa Mon Jan 2 22:19:53 2006 UTC
Modified files:
/php-src/sapi/apache2handler php_functions.c
Log:
MFB51: Fixed possible crash in apache_getenv()/apache_setenv() on invalid
parameters.
http://cvs.php.net/viewcvs.cgi/php-src/sapi/apache2handler/php_functions.c?r1=1.21&r2=1.22&diff_format=u
Index: php-src/sapi/apache2handler/php_functions.c
diff -u php-src/sapi/apache2handler/php_functions.c:1.21
php-src/sapi/apache2handler/php_functions.c:1.22
--- php-src/sapi/apache2handler/php_functions.c:1.21 Sun Jan 1 20:13:31 2006
+++ php-src/sapi/apache2handler/php_functions.c Mon Jan 2 22:19:53 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_functions.c,v 1.21 2006/01/01 20:13:31 iliaa Exp $ */
+/* $Id: php_functions.c,v 1.22 2006/01/02 22:19:53 iliaa Exp $ */
#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
@@ -264,10 +264,13 @@
ctx = SG(server_context);
r = ctx->r;
- if (arg_count == 3 && Z_STRVAL_PP(walk_to_top)) {
- while(r->prev) {
- r = r->prev;
- }
+ if (arg_count == 3) {
+ convert_to_boolean_ex(walk_to_top);
+ if (Z_LVAL_PP(walk_to_top)) {
+ while(r->prev) {
+ r = r->prev;
+ }
+ }
}
convert_to_string_ex(variable);
@@ -300,10 +303,13 @@
ctx = SG(server_context);
r = ctx->r;
- if (arg_count == 2 && Z_STRVAL_PP(walk_to_top)) {
- while(r->prev) {
- r = r->prev;
- }
+ if (arg_count == 2) {
+ convert_to_boolean_ex(walk_to_top);
+ if (Z_LVAL_PP(walk_to_top)) {
+ while(r->prev) {
+ r = r->prev;
+ }
+ }
}
convert_to_string_ex(variable);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php