From ae4d03f988e36252192719d49d1a3bc82f014f3d Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Tue, 14 Dec 2021 12:38:25 +0100 Subject: [PATCH] check for NULL on any valid ION type --- ion_private.h | 8 ++++++++ 1 file changed, 8 insertions(+) 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)); -- 2.30.2