diff options
| author | Pierre Joye <pierre.php@gmail.com> | 2014-05-17 05:41:21 +0200 |
|---|---|---|
| committer | Pierre Joye <pierre.php@gmail.com> | 2014-05-17 05:41:21 +0200 |
| commit | 9b44d687df22761433496c72bad56b8bce3d1978 (patch) | |
| tree | 2d3bc4667a6e2ab78dbe9301cc19d4765cfdc5a8 | |
| parent | 06fe7e1e153381d08478f2cbe26a2296c280b2a0 (diff) | |
| download | php-git-9b44d687df22761433496c72bad56b8bce3d1978.tar.gz | |
fix zend_hash_get_current_data_ptr_ex call
| -rw-r--r-- | ext/pdo/pdo_sql_parser.re | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/pdo/pdo_sql_parser.re b/ext/pdo/pdo_sql_parser.re index 48d80e2684..a1742e397a 100644 --- a/ext/pdo/pdo_sql_parser.re +++ b/ext/pdo/pdo_sql_parser.re @@ -422,8 +422,9 @@ int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char padding = 3; } if(params) { + HashPosition *param_pos; zend_hash_internal_pointer_reset(params); - while (SUCCESS == zend_hash_get_current_data(params, (void**)¶m)) { + while ((param == zend_hash_get_current_data_ptr_ex(params, ¶m_pos)) != NULL) { if(param->parameter) { convert_to_string(param->parameter); /* accommodate a string that needs to be fully quoted @@ -455,9 +456,9 @@ int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char } /* lookup bind first via hash and then index */ /* stupid keys need to be null-terminated, even though we know their length */ - if((SUCCESS == zend_hash_find(params, s.tok, s.cur-s.tok,(void **)¶m)) + if((NULL != zend_hash_find(params, s.tok, s.cur-s.tok,(void **)¶m)) || - (SUCCESS == zend_hash_index_find(params, bindno, (void **)¶m))) + (NULL != zend_hash_index_find(params, bindno, (void **)¶m))) { char *quotedstr; int quotedstrlen; @@ -494,7 +495,7 @@ int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char return (int) (s.cur - inquery); } /* lookup bind by index */ - if(SUCCESS == zend_hash_index_find(params, bindno, (void **)¶m)) + if(NULL != zend_hash_index_find(params, bindno, (void **)¶m)) { char *quotedstr; int quotedstrlen; |
