]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.4' into PHP-8.0
authorNikita Popov <nikita.ppv@gmail.com>
Tue, 2 Feb 2021 09:32:11 +0000 (10:32 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 2 Feb 2021 09:32:11 +0000 (10:32 +0100)
* PHP-7.4:
  Add missing derefs in CurlFile

1  2 
ext/curl/interface.c

index 82d97053eed3a7dbbe120c9c56ba7b23d6d188bf,343e5397772b3fded6905f61377c43543ce12226..2fd6ec1454f29a808561f43233214e268e28c1b8
@@@ -2045,7 -2206,8 +2045,8 @@@ static inline int build_mime_structure_
                        curl_seek_callback seekfunc = seek_cb;
  #endif
  
 -                      prop = zend_read_property(curl_CURLFile_class, current, "name", sizeof("name")-1, 0, &rv);
 +                      prop = zend_read_property(curl_CURLFile_class, Z_OBJ_P(current), "name", sizeof("name")-1, 0, &rv);
+                       ZVAL_DEREF(prop);
                        if (Z_TYPE_P(prop) != IS_STRING) {
                                php_error_docref(NULL, E_WARNING, "Invalid filename for key %s", ZSTR_VAL(string_key));
                        } else {
                                        return 1;
                                }
  
 -                              prop = zend_read_property(curl_CURLFile_class, current, "mime", sizeof("mime")-1, 0, &rv);
 +                              prop = zend_read_property(curl_CURLFile_class, Z_OBJ_P(current), "mime", sizeof("mime")-1, 0, &rv);
+                               ZVAL_DEREF(prop);
                                if (Z_TYPE_P(prop) == IS_STRING && Z_STRLEN_P(prop) > 0) {
                                        type = Z_STRVAL_P(prop);
                                }
 -                              prop = zend_read_property(curl_CURLFile_class, current, "postname", sizeof("postname")-1, 0, &rv);
 +                              prop = zend_read_property(curl_CURLFile_class, Z_OBJ_P(current), "postname", sizeof("postname")-1, 0, &rv);
+                               ZVAL_DEREF(prop);
                                if (Z_TYPE_P(prop) == IS_STRING && Z_STRLEN_P(prop) > 0) {
                                        filename = Z_STRVAL_P(prop);
                                }