iliaa Mon Jul 11 10:46:03 2005 EDT Modified files: /php-src/ext/pdo_mysql mysql_driver.c Log: A bit of further tuning. http://cvs.php.net/diff.php/php-src/ext/pdo_mysql/mysql_driver.c?r1=1.54&r2=1.55&ty=u Index: php-src/ext/pdo_mysql/mysql_driver.c diff -u php-src/ext/pdo_mysql/mysql_driver.c:1.54 php-src/ext/pdo_mysql/mysql_driver.c:1.55 --- php-src/ext/pdo_mysql/mysql_driver.c:1.54 Mon Jul 11 09:52:13 2005 +++ php-src/ext/pdo_mysql/mysql_driver.c Mon Jul 11 10:46:01 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: mysql_driver.c,v 1.54 2005/07/11 13:52:13 andrey Exp $ */ +/* $Id: mysql_driver.c,v 1.55 2005/07/11 14:46:01 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -240,10 +240,10 @@ static int mysql_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC) { pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; - *quoted = emalloc(2*unquotedlen + 3); + *quoted = safe_emalloc(2, unquotedlen, 3); *quotedlen = mysql_real_escape_string(H->server, *quoted + 1, unquoted, unquotedlen); - (*quoted)[0] =(*quoted)[*quotedlen + 1] = '"'; - (*quoted)[*quotedlen+=2] = '\0'; + (*quoted)[0] =(*quoted)[++*quotedlen] = '"'; + (*quoted)[++*quotedlen] = '\0'; return 1; }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php