]> granicus.if.org Git - php/commitdiff
fix void* ptr arithmetic
authorPierre Joye <pierre.php@gmail.com>
Thu, 15 May 2014 16:09:50 +0000 (18:09 +0200)
committerPierre Joye <pierre.php@gmail.com>
Thu, 15 May 2014 16:09:50 +0000 (18:09 +0200)
ext/pdo_pgsql/pgsql_statement.c

index bfceaf4949b667939bb9529a4c2802f15e5e661b..d4cf99f9d1592c0ebde9b8069328cf3ba5c90d88 100644 (file)
@@ -263,7 +263,7 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *
 
                                                if (stmt->bound_param_map && (namevar = zend_hash_find(stmt->bound_param_map,
                                                                param->name)) != NULL) {
-                                                       param->paramno = atoi(Z_PTR_P(namevar) + 1) - 1;
+                                                       param->paramno = atoi(((zend_string*)Z_PTR_P(namevar))->val + 1) - 1;
                                                } else {
                                                        pdo_raise_impl_error(stmt->dbh, stmt, "HY093", param->name->val TSRMLS_CC);
                                                        return 0;