Subject: Add another bounds check: OSS-FUZZ issue 2242 Origin: FILE5_31-21-g55cb70a2 Upstream-Author: Christos Zoulas Date: Mon Jun 19 18:30:25 2017 +0000 --- a/src/softmagic.c +++ b/src/softmagic.c @@ -1199,7 +1199,7 @@ const char *end; size_t lines, linecnt, bytecnt; - if (s == NULL) { + if (s == NULL || nbytes < offset) { ms->search.s_len = 0; ms->search.s = NULL; return 0;