fix possible memory corruption

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31703 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2010-12-03 23:28:43 +00:00
parent 5dd47a135e
commit 34457079a7
2 changed files with 6 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2010-12-03 Richard Frith-Macdonald <rfm@gnu.org>
* Source/Additions/GSMime.m: Fix possible memory corruption when asked
to base64 decode corrupt data with too many '=' characters.
2010-12-02 Eric Wasylishen <ewasylishen@gmail.com>
* Source/NSRegularExpression.m: Add a guard so this file isn't compiled

View file

@ -4030,6 +4030,7 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
buf[i] = '\0';
}
decodebase64(tail, buf);
if (pad > 3) pad = 3;
memcpy(dst, tail, 3 - pad);
dst += 3 - pad;
}