Check for overflow wile decoding

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34833 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2012-02-27 20:18:06 +00:00
parent cdad5b9045
commit 956d76294e

View file

@ -545,6 +545,11 @@ static Class NSDataMallocClass;
count = 0;
for (;;)
{
if (count * 128 < count)
{
[NSException raise: NSInternalInconsistencyException
format: @"overflow in array count"];
}
count *= 128;
(*desImp)(src, desSel, &c, @encode(uint8_t), &cursor, nil);
if (c & 128)