fixed bug in mysql_real_escape_string:

allocated 1 more byte for '\0' terminating character
This commit is contained in:
Georg Richter 2002-07-21 20:16:03 +00:00
parent 8dd639ce22
commit 96276bf8a0

View File

@ -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);
}