Skip to content

Commit bfe9531

Browse files
committed
Initialize int_codepoint in parse_code_point_param()
This is being passed to convert_cp(), and passing an uninitialized value to a function is undefined behavior. Clang 14 makes use of noundef facts aggressively and miscompiles this code if not initialized.
1 parent e98a7a6 commit bfe9531

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/intl/uchar/uchar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static inline int convert_cp(UChar32* pcp, zend_string *string_codepoint, zend_l
3838

3939
static zend_never_inline int parse_code_point_param(INTERNAL_FUNCTION_PARAMETERS, UChar32 *cp) {
4040
zend_string *string_codepoint;
41-
zend_long int_codepoint;
41+
zend_long int_codepoint = 0;
4242
ZEND_PARSE_PARAMETERS_START(1, 1)
4343
Z_PARAM_STR_OR_LONG(string_codepoint, int_codepoint)
4444
ZEND_PARSE_PARAMETERS_END_EX(return FAILURE);

0 commit comments

Comments
 (0)