TODO: reading ints
authorMichael Wallner <mike@php.net>
Tue, 14 Dec 2021 11:41:12 +0000 (12:41 +0100)
committerMichael Wallner <mike@php.net>
Tue, 14 Dec 2021 11:54:08 +0000 (12:54 +0100)
ion_private.h

index aa912635d601423918744060228d66638127a2e6..b6938155454e7f4361b9a277cb08a782c81df178 100644 (file)
@@ -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 */