summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2019-10-18 00:45:46 +0300
committerAndras Timar <andras.timar@collabora.com>2019-11-19 13:27:10 +0100
commit212b2bfde895c2bdd9d7e365832bfce49d1d3168 (patch)
tree19f92e26ff49ef314a0766a42a52dcc450f854ae /extensions
parent8e1a88a9cf8ecc8b939d34d9ba4c87b9ea68bb78 (diff)
tdf#128208: Don't crash if the zip archive is broken
Change-Id: I71f91752e6adeca1970a21c793cad3b5a5aeba13
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/macosx/spotlight/OOoSpotlightImporter.m4
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