From b4c7dbe478f0cfd973eec97a38cc8f3201ac4cef Mon Sep 17 00:00:00 2001 From: Andy Matuschak Date: Wed, 23 Jul 2008 20:54:10 -0700 Subject: [PATCH] Added a guard to the piped unarchiver to fail more gracefully for bad filenames of very short length. --- SUPipedUnarchiver.m | 1 + 1 file changed, 1 insertion(+) diff --git a/SUPipedUnarchiver.m b/SUPipedUnarchiver.m index 0c691e09..e3481ff9 100644 --- a/SUPipedUnarchiver.m +++ b/SUPipedUnarchiver.m @@ -24,6 +24,7 @@ id currentType; while ((currentType = [typeEnumerator nextObject])) { + if ([currentType length] > [lastPathComponent length]) continue; if ([[lastPathComponent substringFromIndex:[lastPathComponent length] - [currentType length]] isEqualToString:currentType]) return NSSelectorFromString([typeSelectorDictionary objectForKey:currentType]); }