From 0f182c2495f3aa84aed76485a4406b383c77c785 Mon Sep 17 00:00:00 2001 From: Matteo Beccati Date: Sun, 10 Jul 2016 14:36:07 +0200 Subject: Fixed bug #72570 Segmentation fault when binding parameters on a query without placeholders Special commit for 7.0.9 --- ext/pdo_pgsql/pgsql_statement.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ext/pdo_pgsql/pgsql_statement.c') diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c index ee06cfc439..c32a81a87a 100644 --- a/ext/pdo_pgsql/pgsql_statement.c +++ b/ext/pdo_pgsql/pgsql_statement.c @@ -292,6 +292,9 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data * break; case PDO_PARAM_EVT_ALLOC: + if (!stmt->bound_param_map) { + return 1; + } if (!zend_hash_index_exists(stmt->bound_param_map, param->paramno)) { pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined"); return 0; -- cgit v1.2.1