diff options
author | Lauri Kenttä <lauri.kentta@gmail.com> | 2016-05-25 20:53:47 +0300 |
---|---|---|
committer | Nikita Popov <nikic@php.net> | 2016-07-07 01:27:23 +0200 |
commit | c1ac081bf1bdd8abb50e9a707bd4ea4a6389b735 (patch) | |
tree | 39ffd8a310053ff20627390fc4cc5b11d11a1973 /ext/standard/base64.c | |
parent | b9c9be13ccbf48c02ad01e19f4fce20c104a003e (diff) | |
download | php-git-c1ac081bf1bdd8abb50e9a707bd4ea4a6389b735.tar.gz |
base64_decode: fix bug #72263 (skips char after padding)
Diffstat (limited to 'ext/standard/base64.c')
-rw-r--r-- | ext/standard/base64.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/standard/base64.c b/ext/standard/base64.c index 6c890e34fc..ea548159c6 100644 --- a/ext/standard/base64.c +++ b/ext/standard/base64.c @@ -157,8 +157,9 @@ PHPAPI zend_string *php_base64_decode_ex(const unsigned char *str, size_t length return NULL; } if (length > 0 && *current != '=' && strict) { - while (--length > 0 && isspace(*++current)) { - continue; + while (length > 0 && isspace(*current)) { + current++; + length--; } if (length == 0 || *current == '\0') { continue; |