]> granicus.if.org Git - file/commitdiff
Allow negative offsets at contination levels > 0
authorChristos Zoulas <christos@zoulas.com>
Tue, 14 Nov 2017 15:19:45 +0000 (15:19 +0000)
committerChristos Zoulas <christos@zoulas.com>
Tue, 14 Nov 2017 15:19:45 +0000 (15:19 +0000)
src/apprentice.c
src/softmagic.c

index 2024a8c49752229bd58420dc012355c912b51d9c..a2e4c68487440c832bc4a08b6958060006d87462 100644 (file)
@@ -32,7 +32,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: apprentice.c,v 1.268 2017/11/10 03:44:05 christos Exp $")
+FILE_RCSID("@(#)$File: apprentice.c,v 1.269 2017/11/14 15:19:45 christos Exp $")
 #endif /* lint */
 
 #include "magic.h"
@@ -1916,6 +1916,7 @@ parse(struct magic_set *ms, struct magic_entry *me, const char *line,
                        file_magwarn(ms, "offset `%s' invalid", l);
                return -1;
        }
+#if 0
         if (m->offset < 0 && cont_level != 0 &&
            (m->flag & (OFFADD | INDIROFFADD)) == 0) {
                if (ms->flags & MAGIC_CHECK) {
@@ -1925,6 +1926,7 @@ parse(struct magic_set *ms, struct magic_entry *me, const char *line,
                }
                return -1;
        }
+#endif
         l = t;
 
        if (m->flag & INDIR) {
index 0526d997827ccfcc44fab0d16fa674a2ae4f393e..a2efa14d3be873244c53ff3814ae4dacaedaca67 100644 (file)
@@ -32,7 +32,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: softmagic.c,v 1.255 2017/11/03 23:27:49 christos Exp $")
+FILE_RCSID("@(#)$File: softmagic.c,v 1.256 2017/11/14 15:19:45 christos Exp $")
 #endif /* lint */
 
 #include "magic.h"
@@ -1354,9 +1354,11 @@ msetoffset(struct magic_set *ms, struct magic *m, struct buffer *bb,
                if (cont_level > 0) {
                        if (m->flag & (OFFADD|INDIROFFADD))
                                goto normal;
+#if 0
                        file_error(ms, 0, "negative offset %d at continuation"
                            "level %u", m->offset, cont_level);
                        return -1;
+#endif
                }
                if (buffer_fill(b) == -1)
                        return -1;