From 96276bf8a088686a146f73cbe52bda7b5df6c4b0 Mon Sep 17 00:00:00 2001 From: Georg Richter Date: Sun, 21 Jul 2002 20:16:03 +0000 Subject: fixed bug in mysql_real_escape_string: allocated 1 more byte for '\0' terminating character --- ext/mysql/php_mysql.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/mysql/php_mysql.c') 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); } -- cgit v1.2.1