Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93531 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43653 invoked from network); 25 May 2016 20:38:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 May 2016 20:38:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=lauri.kentta@gmail.com; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=lauri.kentta@gmail.com; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain gmail.com does not designate 188.117.41.47 as permitted sender) X-PHP-List-Original-Sender: lauri.kentta@gmail.com X-Host-Fingerprint: 188.117.41.47 mailgateway.locotech.fi Linux 2.6 Received: from [188.117.41.47] ([188.117.41.47:56155] helo=mailgateway.locotech.fi) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C3/6C-14311-F5D06475 for ; Wed, 25 May 2016 16:38:56 -0400 Received: from localhost (mailgateway [127.0.0.1]) by mailgateway.locotech.fi (Postfix) with ESMTP id 679AEA35D5F for ; Wed, 25 May 2016 23:38:52 +0300 (EEST) X-Virus-Scanned: amavisd-new at locotech.fi X-Spam-Flag: NO X-Spam-Score: -1.998 X-Spam-Level: X-Spam-Status: No, score=-1.998 tagged_above=-9998 required=5 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=0.9] autolearn=no autolearn_force=no Received: from mailgateway.locotech.fi ([127.0.0.1]) by localhost (mailgateway.locotech.fi [127.0.0.1]) (amavisd-new, port 10024) with LMTP id eBSMHqmsk_64 for ; Wed, 25 May 2016 23:38:37 +0300 (EEST) Received: from posti.fimnet.fi (posti.fimnet.fi [172.16.1.44]) by mailgateway.locotech.fi (Postfix) with ESMTP id 79254A35CC4 for ; Wed, 25 May 2016 23:38:37 +0300 (EEST) Received: from k-piste.dy.fi (unknown [172.16.1.39]) by posti.fimnet.fi (Postfix) with ESMTPSA id 40529100680 for ; Wed, 25 May 2016 23:38:37 +0300 (EEST) Received: from localhost.localdomain ([::1] helo=k-piste.dy.fi) by k-piste.dy.fi with esmtp (Exim 4.87) (envelope-from ) id 1b5fZc-0001BR-UK for internals@lists.php.net; Wed, 25 May 2016 23:38:36 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Wed, 25 May 2016 23:38:36 +0300 To: internals@lists.php.net In-Reply-To: References: Message-ID: <2cfb071d1105043f66138380818fc8cf@k-piste.dy.fi> X-Sender: lauri.kentta@gmail.com User-Agent: Roundcube Webmail/1.2.0 Subject: Re: [PHP-DEV] base64_decode is buggy, what to fix? From: lauri.kentta@gmail.com (=?UTF-8?Q?Lauri_Kentt=C3=A4?=) Thanks for all the comments. Update: > - Null byte ends processing. > - In strict mode, space between padding fails > - In strict mode, after a padding, one character is skipped https://github.com/php/php-src/pull/1923 > - Too short padding is allowed, e.g. "VV=" works like "VV==". > - Extra padding is allowed (like "V====="). WONTFIX / NOTABUG. This doesn't really cause any problems. > - "V" produces empty result, while "V=" fails. Not very logical. Any comments? I'd prefer failing in both cases. 6 bits out of 24 is invalid and might mean that the data is truncated by accident. > - Invalid padding is allowed ("=VVV=", "VV=V=") Any comments? Strict mode at least gets this one right. It's really sad if someone relies on this "feature". -- Lauri Kenttä