From 341faf60512f5a7466ebd38c85c32937397d236e Mon Sep 17 00:00:00 2001 From: Tomasz Kojm Date: Mon, 25 Aug 2008 14:07:18 +0000 Subject: [PATCH] libclamav: drop obsolete code in matcher-ac git-svn: trunk@4140 --- ChangeLog | 4 ++++ libclamav/matcher-ac.c | 5 ++--- libclamav/matcher-ac.h | 3 +-- libclamav/readdb.c | 6 +++--- libclamav/regex_list.c | 1 - 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 319817b3e..6c86938dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon Aug 25 16:03:44 CEST 2008 (tk) +---------------------------------- + * libclamav: drop obsolete code in matcher-ac + Sun Aug 24 23:51:48 CEST 2008 (tk) ---------------------------------- * libclamav/unrar.c: improve handling of currupted archives and downgrade diff --git a/libclamav/matcher-ac.c b/libclamav/matcher-ac.c index 50b80cab7..67b3f9587 100644 --- a/libclamav/matcher-ac.c +++ b/libclamav/matcher-ac.c @@ -878,7 +878,7 @@ int cli_ac_scanbuff(const unsigned char *buffer, uint32_t length, const char **v realoff = offset + bp - pt->prefix_length; - if((pt->offset || pt->target) && (!pt->sigid || pt->partno == 1)) { + if(pt->offset && (!pt->sigid || pt->partno == 1)) { if((fd == -1 && !ftype) || !cli_validatesig(ftype, pt->offset, realoff, &info, fd, pt->virname)) { pt = pt->next_same; continue; @@ -1076,7 +1076,7 @@ int cli_ac_scanbuff(const unsigned char *buffer, uint32_t length, const char **v } /* FIXME: clean up the code */ -int cli_ac_addsig(struct cli_matcher *root, const char *virname, const char *hexsig, uint32_t sigid, uint16_t parts, uint16_t partno, uint16_t rtype, uint16_t type, uint32_t mindist, uint32_t maxdist, const char *offset, uint8_t target, const uint32_t *lsigid, unsigned int options) +int cli_ac_addsig(struct cli_matcher *root, const char *virname, const char *hexsig, uint32_t sigid, uint16_t parts, uint16_t partno, uint16_t rtype, uint16_t type, uint32_t mindist, uint32_t maxdist, const char *offset, const uint32_t *lsigid, unsigned int options) { struct cli_ac_patt *new; char *pt, *pt2, *hex = NULL, *hexcpy = NULL; @@ -1104,7 +1104,6 @@ int cli_ac_addsig(struct cli_matcher *root, const char *virname, const char *hex new->partno = partno; new->mindist = mindist; new->maxdist = maxdist; - new->target = target; new->customdata = NULL; new->ch[0] |= CLI_MATCH_IGNORE; new->ch[1] |= CLI_MATCH_IGNORE; diff --git a/libclamav/matcher-ac.h b/libclamav/matcher-ac.h index de30b5ab2..c0256cc17 100644 --- a/libclamav/matcher-ac.h +++ b/libclamav/matcher-ac.h @@ -62,7 +62,6 @@ struct cli_ac_patt { struct cli_ac_alt **alttable; struct cli_ac_patt *next, *next_same; uint8_t depth; - uint8_t target; uint16_t rtype, type; }; @@ -88,7 +87,7 @@ int cli_ac_scanbuff(const unsigned char *buffer, uint32_t length, const char **v int cli_ac_buildtrie(struct cli_matcher *root); int cli_ac_init(struct cli_matcher *root, uint8_t mindepth, uint8_t maxdepth); void cli_ac_free(struct cli_matcher *root); -int cli_ac_addsig(struct cli_matcher *root, const char *virname, const char *hexsig, uint32_t sigid, uint16_t parts, uint16_t partno, uint16_t rtype, uint16_t type, uint32_t mindist, uint32_t maxdist, const char *offset, uint8_t target, const uint32_t *lsigid, unsigned int options); +int cli_ac_addsig(struct cli_matcher *root, const char *virname, const char *hexsig, uint32_t sigid, uint16_t parts, uint16_t partno, uint16_t rtype, uint16_t type, uint32_t mindist, uint32_t maxdist, const char *offset, const uint32_t *lsigid, unsigned int options); void cli_ac_setdepth(uint8_t mindepth, uint8_t maxdepth); #endif diff --git a/libclamav/readdb.c b/libclamav/readdb.c index a7ed92b36..9e44a300b 100644 --- a/libclamav/readdb.c +++ b/libclamav/readdb.c @@ -183,7 +183,7 @@ int cli_parse_add(struct cli_matcher *root, const char *virname, const char *hex *pt++ = 0; } - if((ret = cli_ac_addsig(root, virname, start, root->ac_partsigs, parts, i, rtype, type, mindist, maxdist, offset, target, lsigid, options))) { + if((ret = cli_ac_addsig(root, virname, start, root->ac_partsigs, parts, i, rtype, type, mindist, maxdist, offset, lsigid, options))) { cli_errmsg("cli_parse_add(): Problem adding signature (1).\n"); error = 1; break; @@ -263,7 +263,7 @@ int cli_parse_add(struct cli_matcher *root, const char *virname, const char *hex return CL_EMALFDB; } - if((ret = cli_ac_addsig(root, virname, pt, root->ac_partsigs, parts, i, rtype, type, 0, 0, offset, target, lsigid, options))) { + if((ret = cli_ac_addsig(root, virname, pt, root->ac_partsigs, parts, i, rtype, type, 0, 0, offset, lsigid, options))) { cli_errmsg("cli_parse_add(): Problem adding signature (2).\n"); free(pt); return ret; @@ -273,7 +273,7 @@ int cli_parse_add(struct cli_matcher *root, const char *virname, const char *hex } } else if(root->ac_only || strpbrk(hexsig, "?(") || type || lsigid) { - if((ret = cli_ac_addsig(root, virname, hexsig, 0, 0, 0, rtype, type, 0, 0, offset, target, lsigid, options))) { + if((ret = cli_ac_addsig(root, virname, hexsig, 0, 0, 0, rtype, type, 0, 0, offset, lsigid, options))) { cli_errmsg("cli_parse_add(): Problem adding signature (3).\n"); return ret; } diff --git a/libclamav/regex_list.c b/libclamav/regex_list.c index d15415c0a..0a5761037 100644 --- a/libclamav/regex_list.c +++ b/libclamav/regex_list.c @@ -620,7 +620,6 @@ static int add_newsuffix(struct regex_matcher *matcher, struct regex_list *info, new->mindist = 0; new->maxdist = 0; new->offset = 0; - new->target = 0; new->length = len; new->ch[0] = new->ch[1] |= CLI_MATCH_IGNORE;