cvs: php4 /main output.c
| From: | Yasuo Ohgaki | Date: | Sat, 04 May 2002 09:46:44 +0000 |
| Subject: | cvs: php4 /main output.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-11660@lists.php.net to get a copy of this message | ||
yohgaki Sat May 4 05:46:44 2002 EDT
Modified files:
/php4/main output.c
Log:
Fixed reference to freed zval string value.
Index: php4/main/output.c
diff -u php4/main/output.c:1.96 php4/main/output.c:1.97
--- php4/main/output.c:1.96 Fri May 3 23:02:51 2002
+++ php4/main/output.c Sat May 4 05:46:44 2002
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: output.c,v 1.96 2002/05/04 03:02:51 yohgaki Exp $ */
+/* $Id: output.c,v 1.97 2002/05/04 09:46:44 yohgaki Exp $ */
#include "php.h"
#include "ext/standard/head.h"
@@ -147,7 +147,7 @@
char *final_buffer=NULL;
unsigned int final_buffer_length=0;
zval *alternate_buffer=NULL;
- char *to_be_destroyed_buffer;
+ char *to_be_destroyed_buffer, *to_be_destoryed_handler_name;
char *to_be_destroyed_handled_output[2] = { 0, 0 };
int status;
php_ob_buffer *prev_ob_buffer_p=NULL;
@@ -226,6 +226,7 @@
}
to_be_destroyed_buffer = OG(active_ob_buffer).buffer;
+ to_be_destoryed_handler_name = OG(active_ob_buffer).handler_name;
if (OG(active_ob_buffer).internal_output_handler
&& (final_buffer != OG(active_ob_buffer).internal_output_handler_buffer)
&& (final_buffer != OG(active_ob_buffer).buffer)) {
@@ -268,6 +269,7 @@
}
if (!just_flush) {
+ efree(to_be_destoryed_handler_name);
efree(to_be_destroyed_buffer);
} else {
OG(active_ob_buffer).text_length = 0;
@@ -363,7 +365,7 @@
OG(active_ob_buffer).status = 0;
OG(active_ob_buffer).internal_output_handler = NULL;
if (output_handler && output_handler->type == IS_STRING) {
- OG(active_ob_buffer).handler_name = Z_STRVAL_P(output_handler);
+ OG(active_ob_buffer).handler_name = estrndup(Z_STRVAL_P(output_handler),
Z_STRLEN_P(output_handler));
}
else if (output_handler && output_handler->type == IS_ARRAY) {
/* FIXME: Array type is not supported yet.