mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fix GH-13354: ext/pgsql: pg_execute, pg_send_query_params and_send_execute null value by reference.
For these, when passing null values by refence, queries return erroneous values unlike pg_query_params behaving as expected. close GH-13355.
This commit is contained in:
parent
7096eff91d
commit
452e008f4f
3 changed files with 87 additions and 3 deletions
|
@ -1288,7 +1288,7 @@ PHP_FUNCTION(pg_execute)
|
|||
params = (char **)safe_emalloc(sizeof(char *), num_params, 0);
|
||||
|
||||
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(pv_param_arr), tmp) {
|
||||
|
||||
ZVAL_DEREF(tmp);
|
||||
if (Z_TYPE_P(tmp) == IS_NULL) {
|
||||
params[i] = NULL;
|
||||
} else {
|
||||
|
@ -3653,7 +3653,7 @@ PHP_FUNCTION(pg_send_query_params)
|
|||
params = (char **)safe_emalloc(sizeof(char *), num_params, 0);
|
||||
|
||||
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(pv_param_arr), tmp) {
|
||||
|
||||
ZVAL_DEREF(tmp);
|
||||
if (Z_TYPE_P(tmp) == IS_NULL) {
|
||||
params[i] = NULL;
|
||||
} else {
|
||||
|
@ -3820,7 +3820,7 @@ PHP_FUNCTION(pg_send_execute)
|
|||
params = (char **)safe_emalloc(sizeof(char *), num_params, 0);
|
||||
|
||||
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(pv_param_arr), tmp) {
|
||||
|
||||
ZVAL_DEREF(tmp);
|
||||
if (Z_TYPE_P(tmp) == IS_NULL) {
|
||||
params[i] = NULL;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue