Re: Feeding NSUnarchiver bad data can cause crash
Re: Feeding NSUnarchiver bad data can cause crash
- Subject: Re: Feeding NSUnarchiver bad data can cause crash
- From: Shawn Erickson <email@hidden>
- Date: Thu, 3 Jun 2004 09:41:59 -0700
On Jun 3, 2004, at 9:12 AM, Jeremy Dronfield wrote:
On 3 Jun 2004, at 5:04 pm, Shawn Erickson wrote:
Or using new runtime/compiler support in 10.3+...
- (BOOL)canBeUnarchived: (NSData *)Target_Data
{
@try {
[NSUarchiver unarchiveObjectWithData: Target_Data];
return YES;
} @catch(NSException e) {
... if you wanted to log something ...
}
return NO;
}
I tried @try. NSUnarchiver crashes out of that too.
You could try using a signal handler (not well versed in this myself at
the moment) to trap the failure, I guess since it doesn't appear to be
throwing an exception in the case you are hitting. Regardless I would
file a bug with Apple about this, in theory it really should attempt to
throw an exception, at least in my opinion.
-Shawn
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.