- XXX: should limit indirect nesting.
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: softmagic.c,v 1.159 2013/02/17 22:28:27 christos Exp $")
+FILE_RCSID("@(#)$File: softmagic.c,v 1.160 2013/02/26 18:24:43 christos Exp $")
#endif /* lint */
#include "magic.h"
if (m->flag & INDIROFFADD) {
offset += ms->c.li[cont_level-1].off;
+ if (offset == 0) {
+ if ((ms->flags & MAGIC_DEBUG) != 0)
+ fprintf(stderr,
+ "indirect *zero* offset\n");
+ return 0;
+ }
if ((ms->flags & MAGIC_DEBUG) != 0)
fprintf(stderr, "indirect +offs=%u\n", offset);
}