libclamav: matcher-bm: fix segfault with short files

git-svn: trunk@719
remotes/push_mirror/metadata
Tomasz Kojm 21 years ago
parent 15d9134a54
commit cd4db86947
  1. 5
      clamav-devel/ChangeLog
  2. 3
      clamav-devel/libclamav/matcher-bm.c

@ -1,3 +1,8 @@
Tue Aug 3 20:20:11 CEST 2004 (tk)
----------------------------------
* libclamav: matcher-bm: fix segfault with short files (problem reported by
Charlie Watts <cewatts*brainstorminternet.net>)
Tue Aug 3 18:50:57 CEST 2004 (tk)
----------------------------------
* clamdscan: print warnings when ignoring options (requested by Tomasz

@ -125,6 +125,9 @@ int cli_bm_scanbuff(const char *buffer, unsigned int length, const char **virnam
char prefix;
if(length < BM_MIN_LENGTH)
return CL_CLEAN;
for(i = BM_MIN_LENGTH - BM_BLOCK_SIZE; i < length - BM_BLOCK_SIZE + 1; ) {
idx = 211 * ((unsigned char) buffer[i]) + 37 * ((unsigned char) buffer[i + 1]) + (unsigned char) buffer[i + 2];

Loading…
Cancel
Save