From: Christos Zoulas Date: Fri, 21 Apr 2017 16:54:57 +0000 (+0000) Subject: - if we failed to get the offset at the current continuation level, reduce it. X-Git-Tag: FILE5_31~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dc067431b12636a63def7c07038351fd8a88aac7;p=file - if we failed to get the offset at the current continuation level, reduce it. - reset continuation level on flush Found by oss-fuzz --- diff --git a/src/softmagic.c b/src/softmagic.c index 39a2cb5a..b7d69938 100644 --- a/src/softmagic.c +++ b/src/softmagic.c @@ -32,7 +32,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: softmagic.c,v 1.247 2017/03/29 15:57:48 christos Exp $") +FILE_RCSID("@(#)$File: softmagic.c,v 1.248 2017/04/21 16:54:57 christos Exp $") #endif /* lint */ #include "magic.h" @@ -192,6 +192,7 @@ flush: while (magindex < nmagic - 1 && magic[magindex + 1].cont_level != 0) magindex++; + cont_level = 0; continue; /* Skip to next top-level test*/ } @@ -370,6 +371,7 @@ flush: case -1: case 0: flush = 1; + cont_level--; break; default: break;