ext/intl: intl_CharFromString using zend_string_truncate to adjust th… (#11575)

* ext/intl: intl_CharFromString using zend_string_truncate to adjust the size of the buffer.
This commit is contained in:
David CARLIER 2023-07-03 16:41:20 +01:00 committed by GitHub
parent 0ce4f91d73
commit 44fa68b064
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -79,8 +79,7 @@ zend_string* intl_charFromString(const UnicodeString &from, UErrorCode *status)
zend_string_free(u8res);
return NULL;
}
ZSTR_VAL(u8res)[actual_len] = '\0';
ZSTR_LEN(u8res) = actual_len;
u8res = zend_string_truncate(u8res, actual_len, 0);
return u8res;
}