]> granicus.if.org Git - file/commitdiff
prevent infinite recursion.
authorChristos Zoulas <christos@zoulas.com>
Tue, 11 Feb 2014 15:41:25 +0000 (15:41 +0000)
committerChristos Zoulas <christos@zoulas.com>
Tue, 11 Feb 2014 15:41:25 +0000 (15:41 +0000)
src/softmagic.c

index 63fc78079cec9d7dcf0a1d4ee27d3ecabe56911f..5d777912263bac0e486d3b75a6283e1421e63bff 100644 (file)
@@ -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;