mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Add assertion to mb_utf7imap_to_wchar to catch buffer overrun
I don't believe such a buffer overrun will ever occur, but just in case the code is changed in the future, it will be good to have an assertion here to help catch bugs. (A similar assertion is already used in the UTF-7 version of this function.)
This commit is contained in:
parent
3944bb01eb
commit
a57fdea149
1 changed files with 1 additions and 0 deletions
|
@ -616,6 +616,7 @@ static size_t mb_utf7imap_to_wchar(unsigned char **in, size_t *in_len, uint32_t
|
|||
if (p == e && base64) {
|
||||
/* UTF7-IMAP doesn't allow strings to end in Base64 mode
|
||||
* One space in output buffer was reserved just for this */
|
||||
ZEND_ASSERT(out < limit);
|
||||
*out++ = MBFL_BAD_INPUT;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue