From: Ilia Alshanetsky Date: Thu, 11 Dec 2008 15:32:24 +0000 (+0000) Subject: Fixed a possible corruption inside PDOStatement::debugDumpParams() X-Git-Tag: php-5.3.0beta1~449 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0594dd91d34cfd246376f6281b0d586833c93068;p=php Fixed a possible corruption inside PDOStatement::debugDumpParams() --- diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index f82261f6a8..4566312d14 100755 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -2209,7 +2209,9 @@ static PHP_METHOD(PDOStatement, debugDumpParams) 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); } php_stream_printf(out TSRMLS_CC, "paramno=%d\nname=[%d] \"%.*s\"\nis_param=%d\nparam_type=%d\n",