cherry-pick.FILE5_30-11-gb1b4efea.pr-598-off-by-one.patch 450 B

12345678910111213141516
  1. Subject: PR/598: Off-by-one
  2. Origin: FILE5_30-11-gb1b4efea
  3. Upstream-Author: Christos Zoulas <christos@zoulas.com>
  4. Date: Tue Mar 7 22:36:10 2017 +0000
  5. --- a/src/softmagic.c
  6. +++ b/src/softmagic.c
  7. @@ -1842,7 +1842,7 @@
  8. v = 0;
  9. for (idx = 0; m->str_range == 0 || idx < m->str_range; idx++) {
  10. - if (slen + idx >= ms->search.s_len)
  11. + if (slen + idx > ms->search.s_len)
  12. return 0;
  13. v = file_strncmp(m->value.s, ms->search.s + idx, slen,