From: Christos Zoulas Date: Tue, 11 Feb 2014 15:41:25 +0000 (+0000) Subject: prevent infinite recursion. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4ced754c4fbc38dfc4524c035e5d52b5deb9cae3;p=file prevent infinite recursion. --- diff --git a/src/softmagic.c b/src/softmagic.c index 63fc7807..5d777912 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.172 2014/01/08 22:22:54 christos Exp $") +FILE_RCSID("@(#)$File: softmagic.c,v 1.173 2014/02/11 15:41:25 christos Exp $") #endif /* lint */ #include "magic.h" @@ -1738,6 +1738,8 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m, break; case FILE_INDIRECT: + if (offset == 0) + return 0; if (OFFSET_OOB(nbytes, offset, 0)) return 0; sbuf = ms->o.buf;