[xdebug-dev] svn: /xdebug/trunk/ tests/bug00558.phpt xdebug.c

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Mon, 05 Apr 2010 13:27:48 +0000

derick Mon, 05 Apr 2010 13:27:48 +0000

Revision: http://svn.xdebug.org/cgi-bin/viewvc.cgi?view=rev&revision=3252&root=xdebug

Log:
- Fixed bug #558: PHP segfaults when running a nested eval.

Changed paths:
    A xdebug/trunk/tests/bug00558.phpt
    U xdebug/trunk/xdebug.c

Added: xdebug/trunk/tests/bug00558.phpt
===================================================================
--- xdebug/trunk/tests/bug00558.phpt (rev 0)
+++ xdebug/trunk/tests/bug00558.phpt 2010-04-05 13:27:48 UTC (rev 3252)
@@ -0,0 +1,11 @@
+--TEST--
+Test for bug #558: PHP segfaults when running a nested eval.
+--FILE--
+<?php
+$any = 'printf("foo\n");';
+eval('eval($any);');
+?>
+--DONE--
+--EXPECT--
+foo
+--DONE--

Modified: xdebug/trunk/xdebug.c
===================================================================
--- xdebug/trunk/xdebug.c 2010-04-05 13:17:52 UTC (rev 3251)
+++ xdebug/trunk/xdebug.c 2010-04-05 13:27:48 UTC (rev 3252)
@@ -452,6 +452,11 @@
                 int tmp_len;

                 inc_filename = xdebug_get_zval(execute_data, &opline->op1, execute_data->Ts, &is_var);
+
+ /* If there is no inc_filename, we're just bailing out instead */
+ if (!inc_filename) {
+ return ZEND_USER_OPCODE_DISPATCH;
+ }

                 if (inc_filename->type != IS_STRING) {
                         tmp_inc_filename = *inc_filename;
Received on Mon Apr 05 2010 - 14:27:48 BST

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