]> granicus.if.org Git - php/commitdiff
fix zend_hash_get_current_data_ptr_ex call
authorPierre Joye <pierre.php@gmail.com>
Sat, 17 May 2014 03:41:21 +0000 (05:41 +0200)
committerPierre Joye <pierre.php@gmail.com>
Sat, 17 May 2014 03:41:21 +0000 (05:41 +0200)
ext/pdo/pdo_sql_parser.re

index 48d80e26841e1adf6e8cdcc606819dcddf7a54cd..a1742e397a65fcf94241d5fafd75ef60effaa876 100644 (file)
@@ -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**)&param)) {
+               while ((param == zend_hash_get_current_data_ptr_ex(params, &param_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 **)&param))  
+                       if((NULL != zend_hash_find(params, s.tok, s.cur-s.tok,(void **)&param))  
                            ||
-                          (SUCCESS == zend_hash_index_find(params, bindno, (void **)&param))) 
+                          (NULL != zend_hash_index_find(params, bindno, (void **)&param))) 
                        {
                                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 **)&param)) 
+                       if(NULL != zend_hash_index_find(params, bindno, (void **)&param)) 
                        {
                                char *quotedstr;
                                int quotedstrlen;