Bug #80203 [PATCH]: imap_mime_header_decode() is not binary safe

From: Date: Thu, 08 Oct 2020 12:19:35 +0000
Subject: Bug #80203 [PATCH]: imap_mime_header_decode() is not binary safe
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-229472@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80203&edit=1 ID: 80203 Patch added by: cmb@php.net Reported by: cmb@php.net Summary: imap_mime_header_decode() is not binary safe Status: Assigned Type: Bug Package: IMAP related Operating System: * PHP Version: 7.3Git-2020-10-08 (Git) Assigned To: cmb Block user comment: N Private report: N New Comment: The following pull request has been associated: Patch Name: Fix #80203: imap_mime_header_decode() is not binary safe On GitHub: https://github.com/php/php-src/pull/6301 Patch: https://github.com/php/php-src/pull/6301.patch Previous Comments: ------------------------------------------------------------------------ [2020-10-08 12:00:27] cmb@php.net Description: ------------ If NUL bytes are encoded in the encoded-word, the decoded text is truncated at that position. Test script: --------------- <?php var_dump(bin2hex(imap_mime_header_decode("=?UTF-8?Q?foo=00bar?=")[0]->text)); var_dump(bin2hex(imap_mime_header_decode("=?UTF-8?B?Zm9vAGJhcg==?=")[0]->text)); ?> Expected result: ---------------- string(14) "666f6f00626172" string(14) "666f6f00626172" Actual result: -------------- string(6) "666f6f" string(6) "666f6f" ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=80203&edit=1

« previous php.bugs (#229472) next »