Browse code

fix detection problem with *.ndb OLE2 signatures

git-svn: trunk@1528

Tomasz Kojm authored on 2005/05/11 04:33:25
Showing 3 changed files
... ...
@@ -1,3 +1,9 @@
1
+Tue May 10 21:29:45 CEST 2005 (tk)
2
+----------------------------------
3
+  * libclamav/matcher-ac.c, libclamav/matcher-bm.c: fix detection problem with
4
+						    *.ndb OLE2 signatures
5
+						    (problem reported by Trog)
6
+
1 7
 Tue May 10 04:47:28 CEST 2005 (tk)
2 8
 ----------------------------------
3 9
   * libclamav/matcher.c: fix signature offset calculation in large files
... ...
@@ -1,10 +1,10 @@
1 1
 /*
2 2
  *  C implementation of the Aho-Corasick pattern matching algorithm. It's based
3
- *  on ScannerDaemon's Java version by Kurt Huwig and
3
+ *  on the ScannerDaemon's version (coded in Java) by Kurt Huwig and
4 4
  *  http://www-sr.informatik.uni-tuebingen.de/~buehler/AC/AC.html
5 5
  *  Thanks to Kurt Huwig for pointing me to this page.
6 6
  *
7
- *  Copyright (C) 2002 - 2004 Tomasz Kojm <tkojm@clamav.net>
7
+ *  Copyright (C) 2002 - 2005 Tomasz Kojm <tkojm@clamav.net>
8 8
  *
9 9
  *  This program is free software; you can redistribute it and/or modify
10 10
  *  it under the terms of the GNU General Public License as published by
... ...
@@ -295,7 +295,8 @@ int cli_ac_scanbuff(const char *buffer, unsigned int length, const char **virnam
295 295
 			    t = type;
296 296
 			else
297 297
 			    t = ftype;
298
-			if(fd == -1 || !cli_validatesig(pt->target, t, pt->offset, offset + position, fd, pt->virname)) {
298
+
299
+			if((fd == -1 && !t) || !cli_validatesig(pt->target, t, pt->offset, offset + position, fd, pt->virname)) {
299 300
 			    pt = pt->next;
300 301
 			    continue;
301 302
 			}
... ...
@@ -1,5 +1,5 @@
1 1
 /*
2
- *  Copyright (C) 2004 Tomasz Kojm <tkojm@clamav.net>
2
+ *  Copyright (C) 2004 - 2005 Tomasz Kojm <tkojm@clamav.net>
3 3
  *
4 4
  *  This program is free software; you can redistribute it and/or modify
5 5
  *  it under the terms of the GNU General Public License as published by
... ...
@@ -180,7 +180,7 @@ int cli_bm_scanbuff(const char *buffer, unsigned int length, const char **virnam
180 180
 		    if(p->target || p->offset) {
181 181
 			off = offset + i - BM_MIN_LENGTH + BM_BLOCK_SIZE;
182 182
 
183
-			if(fd == -1 || !cli_validatesig(p->target, ftype, p->offset, off, fd, p->virname)) {
183
+			if((fd == -1 && !ftype) || !cli_validatesig(p->target, ftype, p->offset, off, fd, p->virname)) {
184 184
 			    p = p->next;
185 185
 			    continue;
186 186
 			}