]> granicus.if.org Git - php/commitdiff
A bit of further tuning.
authorIlia Alshanetsky <iliaa@php.net>
Mon, 11 Jul 2005 14:46:01 +0000 (14:46 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 11 Jul 2005 14:46:01 +0000 (14:46 +0000)
ext/pdo_mysql/mysql_driver.c

index 6002468401e10cd4ac887f6d0bbaf10beb1cae70..b57599c322a066d11bb380fd13b755e52dd5bcc9 100755 (executable)
@@ -240,10 +240,10 @@ static char *pdo_mysql_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigned
 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;
 }