bug-gnustep
[Top][All Lists]
Advanced

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

Crash when trying to load corrupt file with NSDictionary -initWithConten


From: Roland Schwingel
Subject: Crash when trying to load corrupt file with NSDictionary -initWithContentsOfFile:
Date: Thu, 30 Jun 2005 09:02:40 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.3) Gecko/20040910

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

Roland

Attachment: NSSerializer.m.patch.gz
Description: GNU Zip compressed data


reply via email to

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