From 0594dd91d34cfd246376f6281b0d586833c93068 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Thu, 11 Dec 2008 15:32:24 +0000 Subject: [PATCH] Fixed a possible corruption inside PDOStatement::debugDumpParams() --- ext/pdo/pdo_stmt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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", -- 2.50.1