[php-src] master: Fix an integer overflow in to_xml_hexbin (#23771)
| From: | Julien Voisin via GitHub | Date: | Sat, 19 Sep 2026 17:36:58 +0000 |
| Subject: | [php-src] master: Fix an integer overflow in to_xml_hexbin (#23771) | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-141286@lists.php.net to get a copy of this message | ||
Author: Julien Voisin (jvoisin)
Committer: GitHub (web-flow)
Pusher: ndossche
Date: 2026-09-19T19:36:55+02:00
Commit: https://github.com/php/php-src/commit/94ddf35ca9006b0deea8f09c76308df9bf948bfd
Raw diff: https://github.com/php/php-src/commit/94ddf35ca9006b0deea8f09c76308df9bf948bfd.diff
Fix an integer overflow in to_xml_hexbin (#23771)
Changed paths:
M ext/soap/php_encoding.c
Diff:
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c
index 72de145e7b04..044d2058ec09 100644
--- a/ext/soap/php_encoding.c
+++ b/ext/soap/php_encoding.c
@@ -983,7 +983,7 @@ static xmlNodePtr to_xml_hexbin(encodeTypePtr type, zval *data, int style, xmlNo
ZVAL_STR(&tmp, get_serialization_string_from_zval(data));
data = &tmp;
}
- str = (unsigned char *) safe_emalloc(Z_STRLEN_P(data) * 2, sizeof(char), 1);
+ str = (unsigned char *) safe_emalloc(Z_STRLEN_P(data), 2, 1);
for (i = j = 0; i < Z_STRLEN_P(data); i++) {
str[j++] = hexconvtab[((unsigned char)Z_STRVAL_P(data)[i]) >> 4];