mirror of
https://github.com/php/php-src.git
synced 2024-09-23 10:57:26 +00:00
fixed bug in mysql_real_escape_string:
allocated 1 more byte for '\0' terminating character
This commit is contained in:
parent
8dd639ce22
commit
96276bf8a0
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user