diff --git a/file-5.14-no-magic.patch b/file-5.14-no-magic.patch index 139e275..0c46f41 100644 --- a/file-5.14-no-magic.patch +++ b/file-5.14-no-magic.patch @@ -11,3 +11,18 @@ index 7fc0e5c..4641c8b 100644 file_error(ms, 0, "no magic files loaded"); return -1; } +diff --git a/src/softmagic.c b/src/softmagic.c +index def1e63..108d419 100644 +--- a/src/softmagic.c ++++ b/src/softmagic.c +@@ -73,6 +73,10 @@ file_softmagic(struct magic_set *ms, const unsigned char *buf, size_t nbytes, + { + struct mlist *ml; + int rv, printed_something = 0, need_separator = 0; ++ ++ if (!ms->mlist[0]) ++ return 0; ++ + for (ml = ms->mlist[0]->next; ml != ms->mlist[0]; ml = ml->next) + if ((rv = match(ms, ml->magic, ml->nmagic, buf, nbytes, 0, mode, + text, 0, 0, &printed_something, &need_separator, diff --git a/file.spec b/file.spec index 79bcd03..0f7bd41 100644 --- a/file.spec +++ b/file.spec @@ -3,7 +3,7 @@ Summary: A utility for determining file types Name: file Version: 5.14 -Release: 8%{?dist} +Release: 9%{?dist} License: BSD Group: Applications/File Source0: ftp://ftp.astron.com/pub/file/file-%{version}.tar.gz @@ -153,6 +153,9 @@ cd python %endif %changelog +* Tue Jul 02 2013 Jan Kaluza - 5.14-9 +- fix #980446 - do not segfault when no magic is loaded + * Mon Jun 17 2013 Jan Kaluza - 5.14-8 - replace sitearch with sitelib