diff options
author | Christos Zoulas <christos@zoulas.com> | 2017-03-07 22:36:10 +0000 |
---|---|---|
committer | Christos Zoulas <christos@zoulas.com> | 2017-03-07 22:36:10 +0000 |
commit | 6a934149cc67cc9bd13855cfa5ba541fcaf2ef51 (patch) | |
tree | 8d39566255c0cc58c8712083bb5d82f558621a5a | |
parent | 33c3219d72c13a9c0b7ebf8ab2e1e87b8538194b (diff) | |
download | file-git-6a934149cc67cc9bd13855cfa5ba541fcaf2ef51.tar.gz |
PR/598: Off-by-one.
-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 6198eb29..7534da7d 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.244 2017/02/10 18:14:01 christos Exp $") +FILE_RCSID("@(#)$File: softmagic.c,v 1.245 2017/03/07 22:36:10 christos Exp $") #endif /* lint */ #include "magic.h" @@ -1842,7 +1842,7 @@ magiccheck(struct magic_set *ms, struct magic *m) v = 0; for (idx = 0; m->str_range == 0 || idx < m->str_range; idx++) { - if (slen + idx >= ms->search.s_len) + if (slen + idx > ms->search.s_len) return 0; v = file_strncmp(m->value.s, ms->search.s + idx, slen, |