From: Christos Zoulas Date: Wed, 26 Nov 2014 15:33:10 +0000 (+0000) Subject: Complain if alignments are < 4 and repair. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cf15347688124537e6c5dad0a997d126f1c8795a;p=file Complain if alignments are < 4 and repair. --- diff --git a/src/readelf.c b/src/readelf.c index 8543fa1b..b892783b 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -27,7 +27,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: readelf.c,v 1.106 2014/11/22 23:57:44 christos Exp $") +FILE_RCSID("@(#)$File: readelf.c,v 1.107 2014/11/26 15:33:10 christos Exp $") #endif #ifdef BUILTIN_ELF @@ -1200,7 +1200,8 @@ dophn_exec(struct magic_set *ms, int clazz, int swap, int fd, off_t off, /* Things we can determine when we seek */ switch (xph_type) { case PT_NOTE: - if ((align = xph_align) & 0x80000000UL) { + if (((align = xph_align) & 0x80000000UL) != 0 || + align < 4) { if (file_printf(ms, ", invalid note alignment 0x%lx", (unsigned long)align) == -1)