Re: Crash in var_dump and print_r

From: Date: Sun, 26 Aug 2001 15:34:31 +0000
Subject: Re: Crash in var_dump and print_r
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-64351@lists.php.net to get a copy of this message
p.s. casual inspection suggest that having NULL zval pointers in HashTables may break alot of places..... On Sunday, August 26, 2001, at 11:31 AM, George Schlossnagle wrote:
If NULL's a valid zval*, then both of thise routines need to be fixed to handle null pointers. Here's some patches: --- zend.c.orig Sun Aug 26 11:14:28 2001
+++ zend.c      Sun Aug 26 11:20:22 2001
@@ -199,6 +199,10 @@ ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int indent) {
+       if(expr == NULL) {
+               ZEND_PUTS(" (NULL)");
+               return;
+       }
        switch(expr->type) {
                case IS_ARRAY:
                        ZEND_PUTS("Array\n");
--- var.c.orig Thu Aug 16 11:16:52 2001
+++ var.c       Sun Aug 26 11:24:54 2001
@@ -63,7 +63,10 @@
        if (level>1) {
                php_printf("%*c", level-1, ' ');
        }
-
+       if ((*struc) == NULL) {
+               php_printf(" (NULL)");
+               return;
+       }
        switch ((*struc)->type) {
                case IS_BOOL:
                        php_printf("%sbool(%s)\n", COMMON, Z_LVAL_PP(struc)?"true":"false");
On Sunday, August 26, 2001, at 06:15 AM, Zeev Suraski wrote:
It looks like domxml is responsible here. The hash table that's sent to it contains a NULL value, which should be a valid zval *... Zeev At 13:04 26-08-01, Joey Smith wrote:
This may be due to the way domxml is doing things, but the test script in bug #10936 still creates a crash, and the backtrace points to zend_print_zval_r_ex...see attachment 1. Attachment 2 show that var_dump() gives more or less the same result. -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list- admin@lists.php.net
-- Zeev Suraski <zeev@zend.com> CTO & co-founder, Zend Technologies Ltd. http://www.zend.com/ -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list- admin@lists.php.net
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net


« previous php.dev (#64351) next »