libclamav: drop obsolete code in matcher-ac

git-svn: trunk@4140
0.95
Tomasz Kojm 17 years ago
parent f7e2294c17
commit 341faf6051
  1. 4
      ChangeLog
  2. 5
      libclamav/matcher-ac.c
  3. 3
      libclamav/matcher-ac.h
  4. 6
      libclamav/readdb.c
  5. 1
      libclamav/regex_list.c

@ -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

@ -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;

@ -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

@ -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;
}

@ -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;

Loading…
Cancel
Save