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:
rfm 2010-12-03 23:28:43 +00:00
parent a1bde310e3
commit c3b0841b90
2 changed files with 6 additions and 0 deletions

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;
}