From f6cda065cf06f696b316b44fd870c6d0d057aa04 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. --- ext/odbc/php_odbc.c | 2 +- ext/odbc/tests/bug80152.phpt | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 ext/odbc/tests/bug80152.phpt diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index a93252f7c450a..393b8bd29310d 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 0000000000000..719ec3a516864 --- /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)