Skip to content

Commit 44fa68b

Browse files
authored
ext/intl: intl_CharFromString using zend_string_truncate to adjust th… (php#11575)
* ext/intl: intl_CharFromString using zend_string_truncate to adjust the size of the buffer.
1 parent 0ce4f91 commit 44fa68b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

ext/intl/intl_convertcpp.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ zend_string* intl_charFromString(const UnicodeString &from, UErrorCode *status)
7979
zend_string_free(u8res);
8080
return NULL;
8181
}
82-
ZSTR_VAL(u8res)[actual_len] = '\0';
83-
ZSTR_LEN(u8res) = actual_len;
82+
u8res = zend_string_truncate(u8res, actual_len, 0);
8483

8584
return u8res;
8685
}

0 commit comments

Comments
 (0)