Re: archiving report
Re: archiving report
- Subject: Re: archiving report
- From: Ben Kennedy <email@hidden>
- Date: Tue, 26 Feb 2013 23:03:16 -0800
On 26 Feb 2013, at 4:20 pm, Graham Cox wrote:
> I would hesitate to suggest it, but if you are routinely storing NSNull (or @"$null") in arrays, it might point to a flaw in your own design.
As someone pointed out earlier, this bug makes NSKeyedArchiver unusable for any data model that contains user-entered strings. For round-trip behaviour, *all* NSString values passed through NSKeyedArchiver must be filtered on the way in and on the way out.
Sure enough, I just discovered that one of my apps--whose file format is about eight years old and (perhaps unfortunately) based around NSKeyedArchiver--is vulnerable to this bug. Enter the string "$null" into any text field in the doc, save, and that doc will never open again. (Clearly this points to another bug in my own code--an exception is raised due to a nil string being assigned to an NSTextFieldCell--but proves that the magic string "$null" has been turned into nothingness.)
b
--
Ben Kennedy, chief magician
Zygoat Creative Technical Services
http://www.zygoat.ca
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden