]> granicus.if.org Git - file/commitdiff
and non-zero sizes.
authorChristos Zoulas <christos@zoulas.com>
Tue, 9 Dec 2014 02:47:07 +0000 (02:47 +0000)
committerChristos Zoulas <christos@zoulas.com>
Tue, 9 Dec 2014 02:47:07 +0000 (02:47 +0000)
src/readelf.c

index 6a8a07e69cd504d8da77d4743a517d00da1a8424..53d0aa96efe337cb5248268f2b7b342b5dc1854c 100644 (file)
@@ -27,7 +27,7 @@
 #include "file.h"
 
 #ifndef lint
-FILE_RCSID("@(#)$File: readelf.c,v 1.108 2014/11/27 15:16:00 christos Exp $")
+FILE_RCSID("@(#)$File: readelf.c,v 1.109 2014/12/09 02:46:38 christos Exp $")
 #endif
 
 #ifdef BUILTIN_ELF
@@ -1285,7 +1285,7 @@ file_tryelf(struct magic_set *ms, int fd, const unsigned char *buf,
                file_badread(ms);
                return -1;
        }
-       if (S_ISREG(st.st_mode))
+       if (S_ISREG(st.st_mode) || fsize != 0)
                fsize = st.st_size;
        else
                fsize = SIZE_UNKNOWN;