[xdebug-dev] xdebug xdebug/xdebug.c xdebug/tests/bug00173.phpt - Fixed bug #173: Xdebug segfaults using SPL ArrayIterator.

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Fri, 14 Apr 2006 12:07:08 +0200

Date: Fri Apr 14 12:07:08 CEST 2006
User: Derick Rethans
Directory: xdebug

Log Message:
[0.25]
- Fixed bug #173: Xdebug segfaults using SPL ArrayIterator.

Modified files:
           xdebug/xdebug.c (version: 1.310)
Added files:
           xdebug/tests/bug00173.phpt (new version: 1.1)

[FILE: /xdebug/xdebug.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.309
retrieving revision 1.310
diff -u -r1.309 -r1.310
--- xdebug/xdebug.c:1.309 Tue Apr 04 15:01:10 2006 GMT
+++ xdebug/xdebug.c Fri Apr 14 08:07:07 2006 GMT
@@ -1665,7 +1665,9 @@
         xdebug_str_addl(&str, " >=> ", 7, 0);
 
         tmp_value = get_zval_value(retval, 0);
- xdebug_str_add(&str, tmp_value, 1);
+ if (tmp_value) {
+ xdebug_str_add(&str, tmp_value, 1);
+ }
         xdebug_str_addl(&str, "\n", 2, 0);
 
         return str.d;

[FILE: /xdebug/tests/bug00173.phpt]

--TEST--
Test for bug #173: Xdebug segfaults using SPL ArrayIterator.
--INI--
xdebug.default_enable=1
xdebug.auto_trace=1
xdebug.trace_options=0
xdebug.trace_output_dir=/tmp
xdebug.collect_return=1
xdebug.collect_params=1
xdebug.auto_profile=0
xdebug.profiler_enable=0
xdebug.dump_globals=0
xdebug.show_mem_delta=0
xdebug.trace_format=0
--FILE--
<?php
        $trace_file = xdebug_get_tracefile_name();
        new ArrayIterator(NULL);
        echo file_get_contents($trace_file);
        unlink($trace_file);
        echo "DONE\n";
?>
--EXPECTF--
Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Passed variable is not an array or object, using empty array instead' in %sbug00173.php:3
Stack trace:
#0 %sbug00173.php(3): ArrayIterator->__construct(NULL)
#1 {main}
  thrown in %sbug00173.php on line 3
Received on Fri Apr 14 2006 - 12:07:30 BST

This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:03 BST