fix matching of patterns with prefixes and some other issues

git-svn: trunk@3164
This commit is contained in:
Tomasz Kojm
2007-08-06 12:05:42 +00:00
parent ead6d25254
commit 3832cd7c84
2 changed files with 9 additions and 5 deletions

View File

@@ -1,3 +1,8 @@
Mon Aug 6 13:16:39 CEST 2007 (tk)
----------------------------------
* libclamav/matcher-ac.c: fix matching of patterns with prefixes and some
other issues spotted by Glen <daineng*gmail.com>
Fri Aug 3 09:21:12 BST 2007 (njh)
----------------------------------
* clamav-milter/clamav-milter.c: Better use of res_init()

View File

@@ -517,12 +517,11 @@ int cli_ac_scanbuff(const unsigned char *buffer, uint32_t length, const char **v
}
if(pt->partno == 1 || (found && (pt->partno != pt->parts))) {
offmatrix[pt->partno - 1][0] %= (AC_DEFAULT_TRACKLEN + 1);
if(!offmatrix[pt->partno - 1][0])
offmatrix[pt->partno - 1][0]++;
offmatrix[pt->partno - 1][0] %= AC_DEFAULT_TRACKLEN;
offmatrix[pt->partno - 1][0]++;
offmatrix[pt->partno - 1][offmatrix[pt->partno - 1][0]] = realoff + pt->length;
if(pt->partno) /* save realoff for the first part */
offmatrix[pt->partno - 1][offmatrix[pt->partno - 1][0]] = realoff + pt->length + pt->prefix_length;
if(pt->partno == 1) /* save realoff for the first part */
offmatrix[pt->parts - 1][offmatrix[pt->partno - 1][0]] = realoff;
} else if(found && pt->partno == pt->parts) {
if(pt->type) {