]> granicus.if.org Git - file/commitdiff
Complain if alignments are < 4 and repair.
authorChristos Zoulas <christos@zoulas.com>
Wed, 26 Nov 2014 15:33:10 +0000 (15:33 +0000)
committerChristos Zoulas <christos@zoulas.com>
Wed, 26 Nov 2014 15:33:10 +0000 (15:33 +0000)
src/readelf.c

index 8543fa1b969586bd141f2beb6bfb44140eedd4a3..b892783b56e4d0b5ec65eaa546e2d1b7c63a71c8 100644 (file)
@@ -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)