libclamav/matcher-bm.c: properly handle scan boundaries in offset mode (bb#1840)

0.96
Tomasz Kojm 15 years ago
parent 51c9e1dbf6
commit 26f558a6ce
  1. 5
      ChangeLog
  2. 5
      libclamav/matcher-bm.c

@ -1,3 +1,8 @@
Fri Mar 5 21:14:12 CET 2010 (tk)
---------------------------------
* libclamav/matcher-bm.c: properly handle scan boundaries in
offset mode (bb#1840)
Fri Mar 5 19:11:25 CET 2010 (tk)
---------------------------------
* libclamav: fix cl_cvdparse() leak (bb#1859)

@ -269,7 +269,10 @@ int cli_bm_scanbuff(const unsigned char *buffer, uint32_t length, const char **v
memset(&info, 0, sizeof(info));
i = BM_MIN_LENGTH - BM_BLOCK_SIZE;
if(offdata) {
if(offdata->pos == offdata->cnt)
for(; offdata->pos && offdata->offtab[offdata->pos] > offset; offdata->pos--);
if(offdata->offtab[offdata->pos] < offset)
offdata->pos++;
if(offdata->pos >= offdata->cnt)
return CL_CLEAN;
i += offdata->offtab[offdata->pos] - offset;
}

Loading…
Cancel
Save