[php-src] PR #22056: ext/xml: Use zend_string_safe_realloc() for cdata concatenation.
| From: | devnexen | Date: | Fri, 15 May 2026 17:27:14 +0000 |
| Subject: | [php-src] PR #22056: ext/xml: Use zend_string_safe_realloc() for cdata concatenation. | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-36133@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/22056
Author: devnexen
The previous code computed
Z_STRLEN_P(myval) + ZSTR_LEN(decoded_value) as a plain
size_t addition before passing the result to zend_string_extend(), which can wrap on
32-bit and lead to a heap overflow in the following strncpy(). Switch to zend_string_safe_realloc()
so the size computation is bounds-checked.