From: Michael Wallner Date: Tue, 14 Dec 2021 11:38:25 +0000 (+0100) Subject: check for NULL on any valid ION type X-Git-Tag: v0.1.0~81 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=ae4d03f988e36252192719d49d1a3bc82f014f3d;p=awesomized%2Fext-ion check for NULL on any valid ION type --- diff --git a/ion_private.h b/ion_private.h index 93b3058..5ca03da 100644 --- a/ion_private.h +++ b/ion_private.h @@ -1763,6 +1763,14 @@ static inline void php_ion_unserialize_zval(php_ion_unserializer *ser, zval *ret ZVAL_DEREF(return_value); } + if (ION_TYPE_INT(*typ) > 0) { + BOOL is_null; + ION_CHECK(ion_reader_is_null(ser->reader, &is_null)); + if (is_null) { + RETURN_NULL(); + } + } + switch (ION_TYPE_INT(*typ)) { case tid_NULL_INT: ION_CHECK(ion_reader_read_null(ser->reader, typ));