From: George Schlossnagle Date: Thu, 20 May 2004 19:19:04 +0000 (+0000) Subject: sigh... need to include the null byte in hash keys X-Git-Tag: RELEASE_0_1~48 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e155ad208a6cb3f353285d165675578094e93ad4;p=php sigh... need to include the null byte in hash keys --- diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index b6aefbfc41..9849f3b53c 100755 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -502,6 +502,7 @@ static PHP_METHOD(PDOStatement, fetchAll) static int register_bound_param(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, int is_param) { struct pdo_bound_param_data param = {0}; + int name_strlen; param.paramno = -1; param.param_type = PDO_PARAM_STR; @@ -509,7 +510,7 @@ static int register_bound_param(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, if (stmt->dbh->placeholders_can_be_strings || !is_param) { if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "sz|llz!", - ¶m.name, ¶m.namelen, ¶m.parameter, ¶m.param_type, + ¶m.name, &name_strlen, ¶m.parameter, ¶m.param_type, ¶m.max_value_len, ¶m.driver_params)) { if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lz|llz!", ¶m.paramno, @@ -517,6 +518,8 @@ static int register_bound_param(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, return 0; } } + /* since we're hashing this, we need the null byte too */ + param.namelen = name_strlen + 1; } else if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lz|llz!", ¶m.paramno, ¶m.parameter, ¶m.param_type, ¶m.max_value_len, ¶m.driver_params)) { return 0;