diff options
author | Tor Lillqvist <tml@collabora.com> | 2019-10-18 00:45:46 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2019-10-18 00:48:33 +0300 |
commit | d2b36c2674ab382140cf8aa5a4ea457065152f4c (patch) | |
tree | 2df4bd7f7308b026f8a9b3683005a93dc7ef6b07 /extensions/source/macosx/spotlight | |
parent | f8b80054751e83de669f607336e0f24515ea5e35 (diff) |
tdf#128208: Don't crash if the zip archive is broken
Change-Id: I71f91752e6adeca1970a21c793cad3b5a5aeba13
Diffstat (limited to 'extensions/source/macosx/spotlight')
-rw-r--r-- | extensions/source/macosx/spotlight/OOoSpotlightImporter.m | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/extensions/source/macosx/spotlight/OOoSpotlightImporter.m b/extensions/source/macosx/spotlight/OOoSpotlightImporter.m index 07e19332060a..a144fe259562 100644 --- a/extensions/source/macosx/spotlight/OOoSpotlightImporter.m +++ b/extensions/source/macosx/spotlight/OOoSpotlightImporter.m @@ -86,6 +86,8 @@ static unsigned char readByte(NSFileHandle *file) if (tmpBuf == nil) return 0; unsigned char *d = (unsigned char*)[tmpBuf bytes]; + if (d == nil) + return 0; return *d; } @@ -391,7 +393,7 @@ static NSData *getUncompressedData(NSFileHandle *file, NSString *name) if (unzipFile == nil) { //NSLog(@"zip file not open"); - return YES; + return NO; } //first get the metadata |