[xdebug-dev] xdebug xdebug/xdebug_var.c - Fixed issues with empty array indices and binary safety.

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Wed, 22 Feb 2006 22:29:01 +0100

Date: Wed Feb 22 22:29:00 CET 2006
User: Derick Rethans
Directory: xdebug

Log Message:
[1.50]
- Fixed issues with empty array indices and binary safety.

Modified files:
           xdebug/xdebug_var.c (version: 1.68)

[FILE: /xdebug/xdebug_var.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -r1.67 -r1.68
--- xdebug/xdebug_var.c:1.67 Tue Feb 21 20:26:58 2006 GMT
+++ xdebug/xdebug_var.c Wed Feb 22 20:29:00 2006 GMT
@@ -132,9 +132,19 @@
                 xdebug_str_add(str, xdebug_sprintf("%ld => ", hash_key->h), 1);
         } else { /* string key */
                 int newlen = 0;
- char *tmp2 = php_str_to_str(hash_key->arKey, strlen(hash_key->arKey), "'", 1, "\\'", 2, &newlen);
- xdebug_str_add(str, xdebug_sprintf("'%s' => ", tmp2), 1);
-// efree(tmp2);
+ char *tmp, *tmp2;
+
+ tmp = php_str_to_str(hash_key->arKey, hash_key->nKeyLength, "'", 1, "\\'", 2, &newlen);
+ tmp2 = php_str_to_str(tmp, newlen - 1, "\0", 1, "\\0", 2, &newlen);
+ if (tmp) {
+ efree(tmp);
+ }
+ xdebug_str_addl(str, "'", 1, 0);
+ if (tmp2) {
+ xdebug_str_addl(str, tmp2, newlen, 0);
+ efree(tmp2);
+ }
+ xdebug_str_add(str, "' => ", 0);
         }
         xdebug_var_export(zv, str, level + 2, debug_zval TSRMLS_CC);
         xdebug_str_addl(str, ", ", 2, 0);
Received on Wed Feb 22 2006 - 22:29:08 GMT

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