diff options
author | Christos Zoulas <christos@zoulas.com> | 2017-02-07 23:27:32 +0000 |
---|---|---|
committer | Christos Zoulas <christos@zoulas.com> | 2017-02-07 23:27:32 +0000 |
commit | c86065761b64d3bdb5d2b7a29a645a9c59d8153e (patch) | |
tree | 07e84c86b802ac826fb75ca1a2e74fd5a977ebed | |
parent | fb095d341f55d27f0c8588c1adc2a89b9e77a499 (diff) | |
download | file-git-c86065761b64d3bdb5d2b7a29a645a9c59d8153e.tar.gz |
If we exceeded the offset in a search don't break, return 0 (no match)
From Christoph Biedl
-rw-r--r-- | src/softmagic.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/softmagic.c b/src/softmagic.c index 978962b4..358a768c 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.242 2016/12/20 22:44:32 christos Exp $") +FILE_RCSID("@(#)$File: softmagic.c,v 1.243 2017/02/07 23:27:32 christos Exp $") #endif /* lint */ #include "magic.h" @@ -1844,7 +1844,7 @@ magiccheck(struct magic_set *ms, struct magic *m) for (idx = 0; m->str_range == 0 || idx < m->str_range; idx++) { if (slen + idx >= ms->search.s_len) - break; + return 0; v = file_strncmp(m->value.s, ms->search.s + idx, slen, m->str_flags); |