mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Fix for obscure decoding error
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39338 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8650e4cb9e
commit
8eb1eb2a3e
2 changed files with 13 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
2016-02-04 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSData.m: Fix for decoding base64 with unknown characters
|
||||
after a trailing '='
|
||||
|
||||
2016-01-29 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/Additions/GSMime.m: keep key=value pairs in structured fields
|
||||
|
|
|
@ -719,6 +719,14 @@ failure:
|
|||
c = *src++;
|
||||
if (c != '=')
|
||||
{
|
||||
if (options & NSDataBase64DecodingIgnoreUnknownCharacters)
|
||||
{
|
||||
if (!isupper(c) && !islower(c) && !isdigit(c)
|
||||
&& c != '/' && c != '+')
|
||||
{
|
||||
continue; // An unknown character
|
||||
}
|
||||
}
|
||||
free(result);
|
||||
DESTROY(self);
|
||||
return nil;
|
||||
|
|
Loading…
Reference in a new issue