From 2e36e9d06df908fcf02b83c7ea6151a4368850ed Mon Sep 17 00:00:00 2001 From: George Schlossnagle Date: Tue, 18 May 2004 05:34:52 +0000 Subject: [PATCH] only rewrite tmp if quoter returns true --- ext/pdo/pdo_stmt.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index ceb67e6799..1d7d4bbc9d 100755 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -244,7 +244,6 @@ static PHP_METHOD(PDOStatement, execute) while (SUCCESS == zend_hash_get_current_data(Z_ARRVAL_P(input_params), (void*)&tmp)) { char *quotedstr; int quotedstrlen; - int refcount; memset(¶m, 0, sizeof(param)); if (HASH_KEY_IS_STRING == zend_hash_get_current_key_ex(Z_ARRVAL_P(input_params), @@ -266,11 +265,13 @@ static PHP_METHOD(PDOStatement, execute) } param.param_type = PDO_PARAM_STR; - stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), "edstr, "edstrlen TSRMLS_DC); - refcount = (*tmp)->refcount; - zval_dtor(*tmp); - ZVAL_STRINGL(*tmp, quotedstr, quotedstrlen, 0); - (*tmp)->refcount = refcount; + if(stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), + "edstr, "edstrlen TSRMLS_DC)) { + int refcount = (*tmp)->refcount; + zval_dtor(*tmp); + ZVAL_STRINGL(*tmp, quotedstr, quotedstrlen, 0); + (*tmp)->refcount = refcount; + } param.parameter = *tmp; if (!really_register_bound_param(¶m, stmt, 1 TSRMLS_CC)) { -- 2.40.0