aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--xfile.h4
2 files changed, 6 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 414567c..8512f16 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,7 @@
Version 4.8 - 21 Jan 2011, by Per Øyvind Karlsen
+
+- fix a bug causing segfault when trying open a non-existing segfault which
+ for some reaallly odd reason didn't get triggered before now
- remove a last couple of remaining leftovers after db conversion
- really include the workaround for removal issue that was accidentally omitted
in the previous release
diff --git a/xfile.h b/xfile.h
index c8973f5..551e55e 100644
--- a/xfile.h
+++ b/xfile.h
@@ -93,7 +93,9 @@ static xFile xOpen(const char *path) {
cookie = magic_open(MAGIC_NONE);
if(!magic_load(cookie, NULL)) {
message = magic_file(cookie, path);
- if(strstr(message, "gzip compressed"))
+ if(message == NULL)
+ xF.type = XF_FAIL;
+ else if(strstr(message, "gzip compressed"))
xF.type = XF_GZIP;
else if(strstr(message, "xz compressed"))
xF.type = XF_XZ;