Skip to content

Commit b03e267

Browse files
jvoisinLamentXU123
authored andcommitted
Backport: fix integer overflow in to_xml_hexbin (#23771)
Backport PR #23771 from master to PHP-8.4. Original commit: 94ddf35 Closes #23771
1 parent d82f1ff commit b03e267

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎ext/soap/php_encoding.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ static xmlNodePtr to_xml_hexbin(encodeTypePtr type, zval *data, int style, xmlNo
996996
ZVAL_STR(&tmp, get_serialization_string_from_zval(data));
997997
data = &tmp;
998998
}
999-
str = (unsigned char *) safe_emalloc(Z_STRLEN_P(data) * 2, sizeof(char), 1);
999+
str = (unsigned char *) safe_emalloc(Z_STRLEN_P(data), 2, 1);
10001000

10011001
for (i = j = 0; i < Z_STRLEN_P(data); i++) {
10021002
str[j++] = hexconvtab[((unsigned char)Z_STRVAL_P(data)[i]) >> 4];

0 commit comments

Comments
 (0)