cvs: php4 /ext/mysql php_mysql.c
| From: | Georg Richter | Date: | Sun, 21 Jul 2002 20:16:04 +0000 |
| Subject: | cvs: php4 /ext/mysql php_mysql.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-12923@lists.php.net to get a copy of this message | ||
georg Sun Jul 21 16:16:04 2002 EDT
Modified files:
/php4/ext/mysql php_mysql.c
Log:
fixed bug in mysql_real_escape_string:
allocated 1 more byte for '\0' terminating character
Index: php4/ext/mysql/php_mysql.c
diff -u php4/ext/mysql/php_mysql.c:1.145 php4/ext/mysql/php_mysql.c:1.146
--- php4/ext/mysql/php_mysql.c:1.145 Tue Jul 16 15:26:23 2002
+++ php4/ext/mysql/php_mysql.c Sun Jul 21 16:16:03 2002
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_mysql.c,v 1.145 2002/07/16 19:26:23 sniper Exp $ */
+/* $Id: php_mysql.c,v 1.146 2002/07/21 20:16:03 georg Exp $ */
/* TODO:
*
@@ -1625,7 +1625,7 @@
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);
}