mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
Fix to prevent crash (raise exception instead) when deserializing a corrupt file
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@21379 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
2eab253156
commit
233d279560
2 changed files with 19 additions and 2 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2005-06-30 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSSerializer.m: deserializeFromInfo() check that cross
|
||||||
|
reference indices are valid and raise an exception if not ... should
|
||||||
|
fix bug reported by Roland Schwingel, where trying to deserialize a
|
||||||
|
corrupt file could cause a crash.
|
||||||
|
|
||||||
2005-06-28 Adam Fedor <fedor@gnu.org>
|
2005-06-28 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
* Source/NSInvocation.m (-getReturnValue:, -setReturnValue:): Only
|
* Source/NSInvocation.m (-getReturnValue:, -setReturnValue:): Only
|
||||||
|
|
|
@ -520,7 +520,9 @@ static void
|
||||||
endDeserializerInfo(_NSDeserializerInfo* info)
|
endDeserializerInfo(_NSDeserializerInfo* info)
|
||||||
{
|
{
|
||||||
if (info->didUnique)
|
if (info->didUnique)
|
||||||
GSIArrayEmpty(&info->array);
|
{
|
||||||
|
GSIArrayEmpty(&info->array);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static id
|
static id
|
||||||
|
@ -536,7 +538,15 @@ deserializeFromInfo(_NSDeserializerInfo* info)
|
||||||
case ST_XREF:
|
case ST_XREF:
|
||||||
{
|
{
|
||||||
size = (*info->deiImp)(info->data, deiSel, info->cursor);
|
size = (*info->deiImp)(info->data, deiSel, info->cursor);
|
||||||
return RETAIN(GSIArrayItemAtIndex(&info->array, size).obj);
|
if (size < GSIArrayCount(&info->array))
|
||||||
|
{
|
||||||
|
return RETAIN(GSIArrayItemAtIndex(&info->array, size).obj);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[NSException raise: NSInvalidArgumentException
|
||||||
|
format: @"Bad cross reference in property list"];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
case ST_CSTRING:
|
case ST_CSTRING:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue