Re: base64_decode is buggy, what to fix?
| From: | Lauri Kenttä | Date: | Wed, 25 May 2016 20:38:36 +0000 |
| Subject: | Re: base64_decode is buggy, what to fix? | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-93531@lists.php.net to get a copy of this message | ||
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 skippedhttps://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ä