bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Crash when trying to load corrupt file with NSDictionary -initWithCo


From: Richard Frith-Macdonald
Subject: Re: Crash when trying to load corrupt file with NSDictionary -initWithContentsOfFile:
Date: Thu, 30 Jun 2005 08:46:52 +0100

On 2005-06-30 08:02:40 +0100 Roland Schwingel <roland.schwingel@onevision.de> wrote:

Hi...

Recently I discovered a crash when trying to read a file which should contain a NSDictionary (using -[NSDictionary initWithContentsOfFile:]) but instead contained 1736 binary zero bytes (hex 0x00). GNUstep crashed badly when doing this instead of discovering that it contains nothing parseable.

Attached you will find my small patch to fix this. When deserializing it is always checked whether the GSIArray is used or not but not in one case. Added an if to solve this. Now when trying to read this corrupt file I get a correct NSWarnLog() that it does not contain a valid dictionary.

Hope this patch can be applied

I applied a slightly different (more general purpose I hope) fix, intended to catch all cases of bad cross references.
It's in CVS ... I'd appreciate feedback on how it works for you.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]