Modified files:              (Branch: PHP_5_3)
   /php-src/ext/pdo pdo_stmt.c
 Fixed a possible corruption inside PDOStatement::debugDumpParams()
Index: php-src/ext/pdo/pdo_stmt.c
diff -u php-src/ext/pdo/pdo_stmt.c: php-src/ext/pdo/pdo_stmt.c:
@@ -2209,7 +2209,9 @@
 if (res == HASH_KEY_IS_LONG) {
 php_stream_printf(out TSRMLS_CC, "Key: Position #%ld:\n", num);
 } else if (res == HASH_KEY_IS_STRING) {
- php_stream_printf(out TSRMLS_CC, "Key: Name: [%d] %.*s\n", len, len, str);
+ char *s = estrndup(str, len);
+ php_stream_printf(out TSRMLS_CC, "Key: Name: [%d] %.*s\n", len, len, s);
+ efree(s);

Sorry for my ignorance, but isn't the new code exactly equivalent to the old one, albeit a bit slower? I can't really see how a strndup() can fix a corruption there.. If there's some problem, probably it's deeper than this.. Nuno

PHP CVS Mailing List (
To unsubscribe, visit:

Reply via email to