mirror of
https://github.com/google/santa.git
synced 2026-04-24 03:00:12 -04:00
santactl/fileinfo: Don't crash on <512b files
This commit is contained in:
@@ -210,7 +210,7 @@ extern NSString *const NSURLQuarantinePropertiesKey WEAK_IMPORT_ATTRIBUTE;
|
||||
- (BOOL)isDMG {
|
||||
NSUInteger last512 = self.fileSize - 512;
|
||||
const char *magic = (const char *)[[self safeSubdataWithRange:NSMakeRange(last512, 4)] bytes];
|
||||
return (strncmp("koly", magic, 4) == 0);
|
||||
return (magic && strncmp("koly", magic, 4) == 0);
|
||||
}
|
||||
|
||||
#pragma mark Page Zero
|
||||
|
||||
Reference in New Issue
Block a user