diff --git a/Zend/zend_cpuinfo.h b/Zend/zend_cpuinfo.h index c81865c4a4d1a..7e53ba654dd41 100644 --- a/Zend/zend_cpuinfo.h +++ b/Zend/zend_cpuinfo.h @@ -127,58 +127,86 @@ ZEND_API int zend_cpu_supports(zend_cpu_feature feature); * functions */ ZEND_NO_SANITIZE_ADDRESS static inline int zend_cpu_supports_sse2(void) { +#ifdef __aarch64__ + return 0; +#else #ifdef PHP_HAVE_BUILTIN_CPU_INIT __builtin_cpu_init(); #endif return __builtin_cpu_supports("sse2"); +#endif } ZEND_NO_SANITIZE_ADDRESS static inline int zend_cpu_supports_sse3(void) { +#ifdef __aarch64__ + return 0; +#else #ifdef PHP_HAVE_BUILTIN_CPU_INIT __builtin_cpu_init(); #endif return __builtin_cpu_supports("sse3"); +#endif } ZEND_NO_SANITIZE_ADDRESS static inline int zend_cpu_supports_ssse3(void) { +#ifdef __aarch64__ + return 0; +#else #ifdef PHP_HAVE_BUILTIN_CPU_INIT __builtin_cpu_init(); #endif return __builtin_cpu_supports("ssse3"); +#endif } ZEND_NO_SANITIZE_ADDRESS static inline int zend_cpu_supports_sse41(void) { +#ifdef __aarch64__ + return 0; +#else #ifdef PHP_HAVE_BUILTIN_CPU_INIT __builtin_cpu_init(); #endif return __builtin_cpu_supports("sse4.1"); +#endif } ZEND_NO_SANITIZE_ADDRESS static inline int zend_cpu_supports_sse42(void) { +#ifdef __aarch64__ + return 0; +#else #ifdef PHP_HAVE_BUILTIN_CPU_INIT __builtin_cpu_init(); #endif return __builtin_cpu_supports("sse4.2"); +#endif } ZEND_NO_SANITIZE_ADDRESS static inline int zend_cpu_supports_avx(void) { +#ifdef __aarch64__ + return 0; +#else #ifdef PHP_HAVE_BUILTIN_CPU_INIT __builtin_cpu_init(); #endif return __builtin_cpu_supports("avx"); +#endif } ZEND_NO_SANITIZE_ADDRESS static inline int zend_cpu_supports_avx2(void) { +#ifdef __aarch64__ + return 0; +#else #ifdef PHP_HAVE_BUILTIN_CPU_INIT __builtin_cpu_init(); #endif return __builtin_cpu_supports("avx2"); +#endif } #ifdef PHP_HAVE_AVX512_SUPPORTS diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c index 2e9cb6c3ad774..df2b96e68a715 100644 --- a/ext/bcmath/bcmath.c +++ b/ext/bcmath/bcmath.c @@ -991,6 +991,12 @@ static zval *bcmath_number_read_property(zend_object *obj, zend_string *name, in return zend_std_read_property(obj, name, type, cache_slot, rv); } +static zval *bcmath_number_get_property_ptr_ptr(zend_object *object, zend_string *member, int type, void **cache_slot) +{ + /* Must always go through read property because all properties are virtual, and no dynamic properties are allowed. */ + return NULL; +} + static int bcmath_number_has_property(zend_object *obj, zend_string *name, int check_empty, void **cache_slot) { if (check_empty == ZEND_PROPERTY_NOT_EMPTY) { @@ -1034,6 +1040,7 @@ static void bcmath_number_register_class(void) bcmath_number_obj_handlers.unset_property = bcmath_number_unset_property; bcmath_number_obj_handlers.has_property = bcmath_number_has_property; bcmath_number_obj_handlers.read_property = bcmath_number_read_property; + bcmath_number_obj_handlers.get_property_ptr_ptr = bcmath_number_get_property_ptr_ptr; bcmath_number_obj_handlers.get_properties_for = bcmath_number_get_properties_for; bcmath_number_obj_handlers.cast_object = bcmath_number_cast_object; } diff --git a/ext/bcmath/tests/number/gh18641.phpt b/ext/bcmath/tests/number/gh18641.phpt new file mode 100644 index 0000000000000..ed8f55e9145a7 --- /dev/null +++ b/ext/bcmath/tests/number/gh18641.phpt @@ -0,0 +1,13 @@ +--TEST-- +GH-18641 (Accessing a BcMath\Number property by ref crashes) +--EXTENSIONS-- +bcmath +--FILE-- +value; +var_dump($x); +?> +--EXPECT-- +string(1) "1" diff --git a/ext/readline/readline.c b/ext/readline/readline.c index 30f84d610022f..d292921856909 100644 --- a/ext/readline/readline.c +++ b/ext/readline/readline.c @@ -473,13 +473,14 @@ char **php_readline_completion_cb(const char *text, int start, int end) /* libedit will read matches[2] */ matches = calloc(3, sizeof(char *)); if (!matches) { - return NULL; + goto out; } matches[0] = strdup(""); } } } +out: zval_ptr_dtor(¶ms[0]); zval_ptr_dtor(&_readline_array); diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c index a55780615f4d8..a1bd7dff0c8a5 100644 --- a/ext/soap/php_http.c +++ b/ext/soap/php_http.c @@ -411,6 +411,7 @@ int make_http_soap_request(zval *this_ptr, } else { zval_ptr_dtor(¶ms[0]); zval_ptr_dtor(&func); + zval_ptr_dtor(&retval); if (request != buf) { zend_string_release_ex(request, 0); } @@ -1329,6 +1330,7 @@ int make_http_soap_request(zval *this_ptr, } else { zval_ptr_dtor(¶ms[0]); zval_ptr_dtor(&func); + zval_ptr_dtor(&retval); efree(content_encoding); zend_string_release_ex(http_headers, 0); zend_string_release_ex(http_body, 0);