summaryrefslogtreecommitdiffstats
path: root/contrib/file/src/readelf.c
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2015-06-10 19:22:41 +0000
committerdelphij <delphij@FreeBSD.org>2015-06-10 19:22:41 +0000
commit7d7b7b5da36a9fbecf1110d65e3693b9347630d9 (patch)
treebf2d8b473f0726bcdeb36d064078c17b8e7d13cf /contrib/file/src/readelf.c
parent352275060a62b930cc38ca67aff50948c9441845 (diff)
parentc042ae22175d978baeb8b11c92152e4aa035e36a (diff)
downloadFreeBSD-src-7d7b7b5da36a9fbecf1110d65e3693b9347630d9.zip
FreeBSD-src-7d7b7b5da36a9fbecf1110d65e3693b9347630d9.tar.gz
MFV r284234:
Update file to 5.23. MFC after: 2 weeks
Diffstat (limited to 'contrib/file/src/readelf.c')
-rw-r--r--contrib/file/src/readelf.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/contrib/file/src/readelf.c b/contrib/file/src/readelf.c
index d159620..55009e8 100644
--- a/contrib/file/src/readelf.c
+++ b/contrib/file/src/readelf.c
@@ -27,7 +27,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: readelf.c,v 1.117 2014/12/16 23:29:42 christos Exp $")
+FILE_RCSID("@(#)$File: readelf.c,v 1.119 2015/04/09 20:01:41 christos Exp $")
#endif
#ifdef BUILTIN_ELF
@@ -482,6 +482,7 @@ do_note_freebsd_version(struct magic_set *ms, int swap, void *v)
}
private int
+/*ARGSUSED*/
do_bid_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type,
int swap __attribute__((__unused__)), uint32_t namesz, uint32_t descsz,
size_t noff, size_t doff, int *flags)
@@ -622,7 +623,7 @@ do_pax_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type,
return 1;
for (i = 0; i < __arraycount(pax); i++) {
- if (((1 << i) & desc) == 0)
+ if (((1 << (int)i) & desc) == 0)
continue;
if (file_printf(ms, "%s%s", did++ ? "," : "",
pax[i]) == -1)
@@ -1008,7 +1009,8 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num,
}
/* Read offset of name section to be able to read section names later */
- if (pread(fd, xsh_addr, xsh_sizeof, off + size * strtab) < (ssize_t)xsh_sizeof) {
+ if (pread(fd, xsh_addr, xsh_sizeof, CAST(off_t, (off + size * strtab)))
+ < (ssize_t)xsh_sizeof) {
file_badread(ms);
return -1;
}
@@ -1351,7 +1353,7 @@ file_tryelf(struct magic_set *ms, int fd, const unsigned char *buf,
Elf64_Ehdr elf64hdr;
uint16_t type, phnum, shnum, notecount;
- if (ms->flags & (MAGIC_MIME|MAGIC_APPLE))
+ if (ms->flags & (MAGIC_MIME|MAGIC_APPLE|MAGIC_EXTENSION))
return 0;
/*
* ELF executables have multiple section headers in arbitrary
OpenPOWER on IntegriCloud