#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: apprentice.c,v 1.266 2017/11/03 00:18:55 christos Exp $")
+FILE_RCSID("@(#)$File: apprentice.c,v 1.267 2017/11/03 23:38:09 christos Exp $")
#endif /* lint */
#include "magic.h"
file_magwarn(ms, "offset `%s' invalid", l);
return -1;
}
- if (m->offset < 0 && cont_level != 0) {
+ if (m->offset < 0 && cont_level != 0 &&
+ (m->flag & (OFFADD | INDIROFFADD)) == 0) {
if (ms->flags & MAGIC_CHECK) {
- file_magwarn(ms, "negative offset `%s' at level %u",
+ file_magwarn(ms,
+ "negative direct offset `%s' at level %u",
l, cont_level);
}
return -1;