From 4e6d146aabb4efe23666ef2ccdf6ced9e317a33d Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Tue, 14 Dec 2021 12:41:12 +0100 Subject: [PATCH] TODO: reading ints --- ion_private.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ion_private.h b/ion_private.h index aa91263..b693815 100644 --- a/ion_private.h +++ b/ion_private.h @@ -1630,10 +1630,10 @@ static inline void php_ion_reader_read_int(ION_READER *reader, zval *return_valu case IERR_NUMERIC_OVERFLOW: SIZE max, len; ION_CHECK(ion_int_char_length(num, &max)); - zend_string *zs = zend_string_alloc(max-1, 0); + zend_string *zs = zend_string_alloc(max, 0); err = ion_int_to_char(num, (BYTE *) zs->val, max, &len); - ZEND_ASSERT(len == zs->len); + zs->val[zs->len = len] = 0; RETVAL_STR(zs); /* fall through */ -- 2.30.2