From: Christos Zoulas Date: Mon, 20 Oct 2008 19:04:12 +0000 (+0000) Subject: make sure that the error info is set. X-Git-Tag: FILE5_05~301 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0dfa92ca85027faf6c9ff82bf8b463658682cbc9;p=file make sure that the error info is set. --- diff --git a/src/readcdf.c b/src/readcdf.c index 0389e2b8..28b61ee9 100644 --- a/src/readcdf.c +++ b/src/readcdf.c @@ -26,7 +26,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: readcdf.c,v 1.8 2008/10/20 17:20:41 christos Exp $") +FILE_RCSID("@(#)$File: readcdf.c,v 1.9 2008/10/20 19:04:12 christos Exp $") #endif #include @@ -137,8 +137,12 @@ cdf_file_summary_info(struct magic_set *ms, const cdf_stream_t *sst) size_t count; int m; - if (cdf_unpack_summary_info(sst, &si, &info, &count) == -1) - return -1; + if (cdf_unpack_summary_info(sst, &si, &info, &count) == -1) { + if (si.si_byte_order != 0xfffe) + return 0; + else + return -1; + } if (si.si_byte_order != 0xfffe) return 0; @@ -235,7 +239,8 @@ file_trycdf(struct magic_set *ms, int fd, const unsigned char *buf, #ifdef CDF_DEBUG cdf_dump_summary_info(&h, &scn); #endif - i = cdf_file_summary_info(ms, &scn); + if ((i = cdf_file_summary_info(ms, &scn)) == -1) + file_error(ms, errno, "Can't expand summary_info"); free(scn.sst_tab); out4: free(sst.sst_tab);