[xdebug-dev] xdebug xdebug/xdebug.c - Fixed an undefined variable error.

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Thu, 4 Jan 2007 17:15:11 +0100

Date: Thu Jan 4 17:15:11 CET 2007
User: Derick Rethans
Directory: xdebug

Log Message:
[1.00]
- Fixed an undefined variable error.
- Fixed a segfault that occurred when creating printable stack traces and
  collect_params was turned off.

Modified files:
           xdebug/xdebug.c (version: 1.368)

[FILE: /xdebug/xdebug.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.367
retrieving revision 1.368
diff -u -r1.367 -r1.368
--- xdebug/xdebug.c:1.367 Tue Jan 02 15:02:36 2007 GMT
+++ xdebug/xdebug.c Thu Jan 04 15:15:11 2007 GMT
@@ -1114,6 +1114,7 @@
                         if (tmp->user_defined == XDEBUG_EXTERNAL && arguments_sent < arguments_wanted) {
                                 for (i = arguments_sent; i < arguments_wanted; i++) {
                                         tmp->var[tmp->varc].name = xdstrdup(op_array->arg_info[i].name);
+ tmp->var[tmp->varc].addr = NULL;
                                         tmp->varc++;
                                 }
                         }
@@ -1783,22 +1784,26 @@
                                         c = 1;
                                 }
 
- if (html) {
- tmp_value = xdebug_get_zval_value(i->var[j].addr, 0, NULL);
- tmp_fancy_value = xdebug_xmlize(tmp_value, strlen(tmp_value), &newlen);
- tmp_fancy_synop_value = xdebug_get_zval_synopsis_fancy("", i->var[j].addr, &len, 0, NULL TSRMLS_CC);
- xdebug_str_add(&str, xdebug_sprintf("<span title='%s'>%s</span>", tmp_fancy_value, tmp_fancy_synop_value), 1);
- xdfree(tmp_value);
- efree(tmp_fancy_value);
- xdfree(tmp_fancy_synop_value);
- } else {
- tmp_value = xdebug_get_zval_synopsis(i->var[j].addr, 0, NULL);
- if (tmp_value) {
- xdebug_str_add(&str, xdebug_sprintf("%s", tmp_value), 1);
+ if (i->var[j].addr) {
+ if (html) {
+ tmp_value = xdebug_get_zval_value(i->var[j].addr, 0, NULL);
+ tmp_fancy_value = xdebug_xmlize(tmp_value, strlen(tmp_value), &newlen);
+ tmp_fancy_synop_value = xdebug_get_zval_synopsis_fancy("", i->var[j].addr, &len, 0, NULL TSRMLS_CC);
+ xdebug_str_add(&str, xdebug_sprintf("<span title='%s'>%s</span>", tmp_fancy_value, tmp_fancy_synop_value), 1);
                                                 xdfree(tmp_value);
+ efree(tmp_fancy_value);
+ xdfree(tmp_fancy_synop_value);
                                         } else {
- xdebug_str_addl(&str, "???", 3, 0);
+ tmp_value = xdebug_get_zval_synopsis(i->var[j].addr, 0, NULL);
+ if (tmp_value) {
+ xdebug_str_add(&str, xdebug_sprintf("%s", tmp_value), 1);
+ xdfree(tmp_value);
+ } else {
+ xdebug_str_addl(&str, "???", 3, 0);
+ }
                                         }
+ } else {
+ xdebug_str_addl(&str, "???", 3, 0);
                                 }
                         }
 
Received on Thu Jan 04 2007 - 17:15:14 GMT

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