cvs: php4 /ext/standard basic_functions.c basic_functions.h string.c

From: Date: Sat, 04 Aug 2001 16:53:58 +0000
Subject: cvs: php4 /ext/standard basic_functions.c basic_functions.h string.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-6545@lists.php.net to get a copy of this message
thies Sat Aug 4 12:53:58 2001 EDT Modified files: /php4/ext/standard basic_functions.c basic_functions.h string.c Log: fix possible crash - we should never keep the zval** as they might point somewhere into the Engine. (there's still a new bug in strtok - hunting;-) Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.375 php4/ext/standard/basic_functions.c:1.376 --- php4/ext/standard/basic_functions.c:1.375 Fri Aug 3 05:50:38 2001 +++ php4/ext/standard/basic_functions.c Sat Aug 4 12:53:53 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: basic_functions.c,v 1.375 2001/08/03 09:50:38 sas Exp $ */ +/* $Id: basic_functions.c,v 1.376 2001/08/04 16:53:53 thies Exp $ */ #include "php.h" #include "php_main.h" @@ -894,7 +894,7 @@ PHP_RSHUTDOWN_FUNCTION(basic) { if (BG(strtok_zval)) - zval_ptr_dtor(BG(strtok_zval)); + zval_ptr_dtor(&BG(strtok_zval)); BG(strtok_string) = NULL; BG(strtok_zval) = NULL; #ifdef HAVE_PUTENV Index: php4/ext/standard/basic_functions.h diff -u php4/ext/standard/basic_functions.h:1.86 php4/ext/standard/basic_functions.h:1.87 --- php4/ext/standard/basic_functions.h:1.86 Fri Aug 3 05:50:38 2001 +++ php4/ext/standard/basic_functions.h Sat Aug 4 12:53:57 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: basic_functions.h,v 1.86 2001/08/03 09:50:38 sas Exp $ */ +/* $Id: basic_functions.h,v 1.87 2001/08/04 16:53:57 thies Exp $ */ #ifndef BASIC_FUNCTIONS_H #define BASIC_FUNCTIONS_H @@ -141,7 +141,7 @@ typedef struct { HashTable *user_shutdown_function_names; HashTable putenv_ht; - zval **strtok_zval; + zval *strtok_zval; char *strtok_string; char *locale_string; char *strtok_last; Index: php4/ext/standard/string.c diff -u php4/ext/standard/string.c:1.217 php4/ext/standard/string.c:1.218 --- php4/ext/standard/string.c:1.217 Fri Aug 3 19:10:04 2001 +++ php4/ext/standard/string.c Sat Aug 4 12:53:57 2001 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: string.c,v 1.217 2001/08/03 23:10:04 jeroen Exp $ */ +/* $Id: string.c,v 1.218 2001/08/04 16:53:57 thies Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -867,8 +867,8 @@ zval_add_ref(str); if (BG(strtok_zval)) - zval_ptr_dtor(BG(strtok_zval)); - BG(strtok_zval) = str; + zval_ptr_dtor(&BG(strtok_zval)); + BG(strtok_zval) = *str; BG(strtok_last) = BG(strtok_string) = Z_STRVAL_PP(str); BG(strtok_len) = Z_STRLEN_PP(str);

« previous php.cvs (#6545) next »