diff options
author | Lauri Kenttä <lauri.kentta@gmail.com> | 2016-05-25 20:53:47 +0300 |
---|---|---|
committer | Nikita Popov <nikic@php.net> | 2016-07-05 16:51:36 +0200 |
commit | 6d17ee744f52db2e6e598fd510dee8ba039480f2 (patch) | |
tree | bffe0b00838d7e8b8c18e3da583fe615f6d68565 /ext/standard/base64.c | |
parent | 260c07db850266d2d65cff446ec98d4a4752d41c (diff) | |
download | php-git-6d17ee744f52db2e6e598fd510dee8ba039480f2.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; |