From: Michael Wallner Date: Thu, 19 May 2022 08:21:09 +0000 (+0200) Subject: fix crash caused by uninitialized zval when unserializing properties X-Git-Tag: v0.2.1~3 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=50cf5a89b0454e69d86e400fa6f7ed1733c20f28;p=awesomized%2Fext-ion fix crash caused by uninitialized zval when unserializing properties --- diff --git a/ion_private.h b/ion_private.h index 21e3558..27c2670 100644 --- a/ion_private.h +++ b/ion_private.h @@ -2360,6 +2360,7 @@ static void php_ion_unserialize_props(php_ion_unserializer *ser, zval *return_va ION_CATCH(); zval zvalue; + ZVAL_UNDEF(&zvalue); php_ion_unserialize_zval(ser, &zvalue, &typ); ION_CATCH(zend_string_release(key)); diff --git a/tests/unserialize/executor_globals.phpt b/tests/unserialize/executor_globals.phpt new file mode 100644 index 0000000..5d23d17 --- /dev/null +++ b/tests/unserialize/executor_globals.phpt @@ -0,0 +1,22 @@ +--TEST-- +ion\unserialize/executor_globals +--EXTENSIONS-- +ion +--FILE-- +TEST +s = new ion\Serializer\Serializer; + +$c->u = new ion\Unserializer\Unserializer; +$d = $c->s->serialize($c); +$c->u->unserialize($d); +?> +DONE +--EXPECT-- +TEST +DONE