[php-src] master: Merge branch 'PHP-8.6'
| From: | Daniel Scherzer | Date: | Mon, 28 Sep 2026 23:56:52 +0000 |
| Subject: | [php-src] master: Merge branch 'PHP-8.6' | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-141658@lists.php.net to get a copy of this message | ||
Author: Daniel Scherzer (DanielEScherzer)
Date: 2026-09-28T16:56:26-07:00
Commit: https://github.com/php/php-src/commit/b4c31fb79dbfb7398ce5112a488640e36d13e149
Raw diff: https://github.com/php/php-src/commit/b4c31fb79dbfb7398ce5112a488640e36d13e149.diff
Merge branch 'PHP-8.6'
* PHP-8.6:
ext/mbstring: assert that
mb_wchar_to_uuencode() pointer write is in bounds (#23955)
Changed paths:
M ext/mbstring/libmbfl/filters/mbfilter_uuencode.c
Diff:
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_uuencode.c
b/ext/mbstring/libmbfl/filters/mbfilter_uuencode.c
index 600d019b9d49..896b95279717 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_uuencode.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_uuencode.c
@@ -287,6 +287,9 @@ static void mb_wchar_to_uuencode(uint32_t *in, size_t len, mb_convert_buf *buf,
if (n_cached_bits) {
len_byte -= (n_cached_bits == 2) ? 1 : 2;
}
+ /* The byte we are writing to must be part of the same buffer */
+ ZEND_ASSERT(len_byte >= (unsigned char *)ZSTR_VAL(buf->str));
+ ZEND_ASSERT(len_byte < limit);
*len_byte = MIN(bytes_encoded + len + (n_cached_bits ? (n_cached_bits == 2 ? 1 : 2) : 0), 45) +
32;
if (n_cached_bits) {