summaryrefslogtreecommitdiff
path: root/ext/mysql/php_mysql.c
diff options
context:
space:
mode:
authorGeorg Richter <georg@php.net>2002-07-21 20:16:03 +0000
committerGeorg Richter <georg@php.net>2002-07-21 20:16:03 +0000
commit96276bf8a088686a146f73cbe52bda7b5df6c4b0 (patch)
treec308f0aa2a6b0959ef633474171945ee84e40025 /ext/mysql/php_mysql.c
parent8dd639ce2290c5b536eb1ccba4203f0b9d8a5ffb (diff)
downloadphp-git-96276bf8a088686a146f73cbe52bda7b5df6c4b0.tar.gz
fixed bug in mysql_real_escape_string:
allocated 1 more byte for '\0' terminating character
Diffstat (limited to 'ext/mysql/php_mysql.c')
-rw-r--r--ext/mysql/php_mysql.c2
1 files changed, 1 insertions, 1 deletions
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);
}