From bf5f07cc8b99db53457afb87ee3e996a40a80d24 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Sat, 26 Sep 2020 13:14:40 +0200 Subject: [PATCH] Fix #80152: odbc_execute() moves internal pointer of $params As least intrusive fix, we separate the passed array argument. Closes GH-6219. --- NEWS | 1 + ext/odbc/php_odbc.c | 2 +- ext/odbc/tests/bug80152.phpt | 26 ++++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 ext/odbc/tests/bug80152.phpt diff --git a/NEWS b/NEWS index 923d95cd5c..a090a64eee 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,7 @@ PHP NEWS . Fixed bug #80147 (BINARY strings may not be properly zero-terminated). (cmb) . Fixed bug #80150 (Failure to fetch error message). (cmb) + . Fixed bug #80152 (odbc_execute() moves internal pointer of $params). (cmb) - OPcache: . Fixed bug #80083 (Optimizer pass 6 removes variables used for ibm_db2 data diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index e26368dfeb..0722a91e34 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -1309,7 +1309,7 @@ PHP_FUNCTION(odbc_execute) int numArgs = ZEND_NUM_ARGS(), i, ne; RETCODE rc; - if (zend_parse_parameters(numArgs, "r|a", &pv_res, &pv_param_arr) == FAILURE) { + if (zend_parse_parameters(numArgs, "r|a/", &pv_res, &pv_param_arr) == FAILURE) { return; } diff --git a/ext/odbc/tests/bug80152.phpt b/ext/odbc/tests/bug80152.phpt new file mode 100644 index 0000000000..719ec3a516 --- /dev/null +++ b/ext/odbc/tests/bug80152.phpt @@ -0,0 +1,26 @@ +--TEST-- +Bug #80152 (odbc_execute() moves internal pointer of $params) +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECT-- +int(0) +int(0) -- 2.40.0