Update php_base64_decode() to cover Bug52327
Strict mode should fail on padding characters mid-stream.
Esse commit está contido em:
@@ -1884,7 +1884,15 @@ static unsigned char *php_base64_decode(const unsigned char *str,
|
||||
/* run through the whole string, converting as we go */
|
||||
while ((ch = *current++) != '\0' && length-- > 0) {
|
||||
if (ch == base64_pad) {
|
||||
if (*current != '=' && (i % 4) == 1) {
|
||||
if (*current != '=' && ((i % 4) == 1 || (strict && length > 0))) {
|
||||
if ((i % 4) != 1) {
|
||||
while (isspace(*(++current))) {
|
||||
continue;
|
||||
}
|
||||
if (*current == '\0') {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
free(result);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário