From cbe9f57a17c8646418268fdd4bb64c5b6cd9bad8 Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Wed, 25 Aug 2010 22:03:03 +0000 Subject: [PATCH] - Fixed bug #52699 (PDO bindValue writes long int 32bit enum) --- ext/pdo/pdo_stmt.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 6127a443dc..c57a14a781 100755 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -1624,18 +1624,20 @@ static int register_bound_param(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, static PHP_METHOD(PDOStatement, bindValue) { struct pdo_bound_param_data param = {0}; + long param_type = PDO_PARAM_STR; PHP_STMT_GET_OBJ; param.paramno = -1; - param.param_type = PDO_PARAM_STR; if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, - "lz/|l", ¶m.paramno, ¶m.parameter, ¶m.param_type)) { + "lz/|l", ¶m.paramno, ¶m.parameter, ¶m_type)) { if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/|l", ¶m.name, - ¶m.namelen, ¶m.parameter, ¶m.param_type)) { + ¶m.namelen, ¶m.parameter, ¶m_type)) { RETURN_FALSE; } } + + param.param_type = (int) param_type; if (param.paramno > 0) { --param.paramno; /* make it zero-based internally */ -- 2.40.0