aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS4
-rw-r--r--xfile.h6
2 files changed, 9 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 15bc54c..70596b1 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+Version 4.14 - Jan 2011, by Per Øyvind Karlsen
+
+- fix segfault when trying to open non-existing synthesis
+
Version 4.13 - 24 Jan 2011, by Per Øyvind Karlsen
- move disttag/distepoch pattern matching breakage hack into rpm
diff --git a/xfile.h b/xfile.h
index 551e55e..7c26e66 100644
--- a/xfile.h
+++ b/xfile.h
@@ -117,12 +117,16 @@ static xFile xOpen(const char *path) {
switch(xF.type) {
case XF_GZIP:
xF.f.gz = gzopen(path, "rb");
+ if(xF.f.gz == NULL)
+ xF.type = XF_FAIL;
break;
case XF_ASCII:
case XF_LZMA:
case XF_XZ:
xF.fp = fopen(path, "rb");
- if(xF.type == XF_ASCII) break;
+ if(xF.fp == NULL)
+ xF.type = XF_FAIL;
+ if(xF.type == XF_ASCII || xF.type == XF_FAIL) break;
xF.f.xz = lzma_open(&ret, xF.fp, -1);
if(ret != LZMA_OK)
xF.type = XF_FAIL;