]> 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 ac9c18bdcabf40af9f84bd6af05d80c491739e7a..e0db1c7fedaaf85dc81d36158d2136d6ae74fcac 100644 (file)
@@ -32,7 +32,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: softmagic.c,v 1.171 2014/01/08 22:02:06 christos Exp $")
+FILE_RCSID("@(#)$File: softmagic.c,v 1.172 2014/01/08 22:22:54 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;