explicitly allow null to avoid warning in 8.1
authorMichael Wallner <mike@php.net>
Wed, 10 Mar 2021 09:17:01 +0000 (10:17 +0100)
committerMichael Wallner <mike@php.net>
Wed, 10 Mar 2021 09:17:01 +0000 (10:17 +0100)
src/php_http_params.c

index 44f01c32992df9b872f8bddcf28c6a5c846e9d0a..8ac4f8f7a55ac0f28b730f41d317e6dc900945be 100644 (file)
@@ -1249,14 +1249,14 @@ PHP_METHOD(HttpParams, offsetSet)
        zend_string *name;
        zval zparams_tmp, *zparam, *zparams, *nvalue;
 
-       if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "Sz", &name, &nvalue)) {
+       if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "S!z", &name, &nvalue)) {
                return;
        }
 
        zparams = zend_read_property(php_http_params_class_entry, Z_OBJ_P(ZEND_THIS), ZEND_STRL("params"), 0, &zparams_tmp);
        convert_to_array(zparams);
 
-       if (name->len) {
+       if (name && name->len) {
                if (Z_TYPE_P(nvalue) == IS_ARRAY) {
                        if ((zparam = zend_symtable_find(Z_ARRVAL_P(zparams), name))) {
                                convert_to_array(zparam);