git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@719 77e5149b-7576-45b1-b177-96237e5ba77b
Tomasz Kojm authored on 2004/08/04 03:25:26... | ... |
@@ -1,3 +1,8 @@ |
1 |
+Tue Aug 3 20:20:11 CEST 2004 (tk) |
|
2 |
+---------------------------------- |
|
3 |
+ * libclamav: matcher-bm: fix segfault with short files (problem reported by |
|
4 |
+ Charlie Watts <cewatts*brainstorminternet.net>) |
|
5 |
+ |
|
1 | 6 |
Tue Aug 3 18:50:57 CEST 2004 (tk) |
2 | 7 |
---------------------------------- |
3 | 8 |
* 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 |
125 | 125 |
char prefix; |
126 | 126 |
|
127 | 127 |
|
128 |
+ if(length < BM_MIN_LENGTH) |
|
129 |
+ return CL_CLEAN; |
|
130 |
+ |
|
128 | 131 |
for(i = BM_MIN_LENGTH - BM_BLOCK_SIZE; i < length - BM_BLOCK_SIZE + 1; ) { |
129 | 132 |
idx = 211 * ((unsigned char) buffer[i]) + 37 * ((unsigned char) buffer[i + 1]) + (unsigned char) buffer[i + 2]; |
130 | 133 |
|