From: Georg Richter Date: Sun, 21 Jul 2002 20:16:03 +0000 (+0000) Subject: fixed bug in mysql_real_escape_string: X-Git-Tag: dev~210 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=96276bf8a088686a146f73cbe52bda7b5df6c4b0;p=php fixed bug in mysql_real_escape_string: allocated 1 more byte for '\0' terminating character --- diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c index a9c789fa53..cf81a63cf3 100644 --- a/ext/mysql/php_mysql.c +++ b/ext/mysql/php_mysql.c @@ -1625,7 +1625,7 @@ PHP_FUNCTION(mysql_real_escape_string) new_str = emalloc(str_len * 2 + 1); new_str_len = mysql_real_escape_string(&mysql->conn, new_str, str, str_len); - new_str = erealloc(new_str, new_str_len); + new_str = erealloc(new_str, new_str_len + 1); RETURN_STRINGL(new_str, new_str_len, 0); }