]> granicus.if.org Git - file/commitdiff
Fix:
authorChristos Zoulas <christos@zoulas.com>
Mon, 5 Jan 2015 20:21:30 +0000 (20:21 +0000)
committerChristos Zoulas <christos@zoulas.com>
Mon, 5 Jan 2015 20:21:30 +0000 (20:21 +0000)
perl -e 'print "\x0" x 8, "bad", "\x0" x 1013, "H+", "\x0" x 6, "good"' | ./file
printing bad...
Reset the continuation offset. From Christoph Biedl

src/softmagic.c

index f42d4eb71dae29d11cee11f49c8e7d32216bc27e..b367c4b2767fdafda7937e6c4ea08bbefe8cac96 100644 (file)
@@ -32,7 +32,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: softmagic.c,v 1.209 2015/01/05 20:05:39 christos Exp $")
+FILE_RCSID("@(#)$File: softmagic.c,v 1.210 2015/01/05 20:21:30 christos Exp $")
 #endif /* lint */
 
 #include "magic.h"
@@ -361,6 +361,7 @@ match(struct magic_set *ms, struct magic *magic, uint32_t nmagic,
                if ((ms->flags & MAGIC_CONTINUE) == 0 && *printed_something) {
                        return *returnval; /* don't keep searching */
                }
+               cont_level = 0;
        }
        return *returnval;  /* This is hit if -k is set or there is no match */
 }