git-svn: trunk@4140
Tomasz Kojm authored on 2008/08/25 23:07:18... | ... |
@@ -1,3 +1,7 @@ |
1 |
+Mon Aug 25 16:03:44 CEST 2008 (tk) |
|
2 |
+---------------------------------- |
|
3 |
+ * libclamav: drop obsolete code in matcher-ac |
|
4 |
+ |
|
1 | 5 |
Sun Aug 24 23:51:48 CEST 2008 (tk) |
2 | 6 |
---------------------------------- |
3 | 7 |
* 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 |
878 | 878 |
|
879 | 879 |
realoff = offset + bp - pt->prefix_length; |
880 | 880 |
|
881 |
- if((pt->offset || pt->target) && (!pt->sigid || pt->partno == 1)) { |
|
881 |
+ if(pt->offset && (!pt->sigid || pt->partno == 1)) { |
|
882 | 882 |
if((fd == -1 && !ftype) || !cli_validatesig(ftype, pt->offset, realoff, &info, fd, pt->virname)) { |
883 | 883 |
pt = pt->next_same; |
884 | 884 |
continue; |
... | ... |
@@ -1076,7 +1076,7 @@ int cli_ac_scanbuff(const unsigned char *buffer, uint32_t length, const char **v |
1076 | 1076 |
} |
1077 | 1077 |
|
1078 | 1078 |
/* FIXME: clean up the code */ |
1079 |
-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) |
|
1079 |
+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) |
|
1080 | 1080 |
{ |
1081 | 1081 |
struct cli_ac_patt *new; |
1082 | 1082 |
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 |
1104 | 1104 |
new->partno = partno; |
1105 | 1105 |
new->mindist = mindist; |
1106 | 1106 |
new->maxdist = maxdist; |
1107 |
- new->target = target; |
|
1108 | 1107 |
new->customdata = NULL; |
1109 | 1108 |
new->ch[0] |= CLI_MATCH_IGNORE; |
1110 | 1109 |
new->ch[1] |= CLI_MATCH_IGNORE; |
... | ... |
@@ -62,7 +62,6 @@ struct cli_ac_patt { |
62 | 62 |
struct cli_ac_alt **alttable; |
63 | 63 |
struct cli_ac_patt *next, *next_same; |
64 | 64 |
uint8_t depth; |
65 |
- uint8_t target; |
|
66 | 65 |
uint16_t rtype, type; |
67 | 66 |
}; |
68 | 67 |
|
... | ... |
@@ -88,7 +87,7 @@ int cli_ac_scanbuff(const unsigned char *buffer, uint32_t length, const char **v |
88 | 88 |
int cli_ac_buildtrie(struct cli_matcher *root); |
89 | 89 |
int cli_ac_init(struct cli_matcher *root, uint8_t mindepth, uint8_t maxdepth); |
90 | 90 |
void cli_ac_free(struct cli_matcher *root); |
91 |
-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); |
|
91 |
+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); |
|
92 | 92 |
void cli_ac_setdepth(uint8_t mindepth, uint8_t maxdepth); |
93 | 93 |
|
94 | 94 |
#endif |
... | ... |
@@ -183,7 +183,7 @@ int cli_parse_add(struct cli_matcher *root, const char *virname, const char *hex |
183 | 183 |
*pt++ = 0; |
184 | 184 |
} |
185 | 185 |
|
186 |
- if((ret = cli_ac_addsig(root, virname, start, root->ac_partsigs, parts, i, rtype, type, mindist, maxdist, offset, target, lsigid, options))) { |
|
186 |
+ if((ret = cli_ac_addsig(root, virname, start, root->ac_partsigs, parts, i, rtype, type, mindist, maxdist, offset, lsigid, options))) { |
|
187 | 187 |
cli_errmsg("cli_parse_add(): Problem adding signature (1).\n"); |
188 | 188 |
error = 1; |
189 | 189 |
break; |
... | ... |
@@ -263,7 +263,7 @@ int cli_parse_add(struct cli_matcher *root, const char *virname, const char *hex |
263 | 263 |
return CL_EMALFDB; |
264 | 264 |
} |
265 | 265 |
|
266 |
- if((ret = cli_ac_addsig(root, virname, pt, root->ac_partsigs, parts, i, rtype, type, 0, 0, offset, target, lsigid, options))) { |
|
266 |
+ if((ret = cli_ac_addsig(root, virname, pt, root->ac_partsigs, parts, i, rtype, type, 0, 0, offset, lsigid, options))) { |
|
267 | 267 |
cli_errmsg("cli_parse_add(): Problem adding signature (2).\n"); |
268 | 268 |
free(pt); |
269 | 269 |
return ret; |
... | ... |
@@ -273,7 +273,7 @@ int cli_parse_add(struct cli_matcher *root, const char *virname, const char *hex |
273 | 273 |
} |
274 | 274 |
|
275 | 275 |
} else if(root->ac_only || strpbrk(hexsig, "?(") || type || lsigid) { |
276 |
- if((ret = cli_ac_addsig(root, virname, hexsig, 0, 0, 0, rtype, type, 0, 0, offset, target, lsigid, options))) { |
|
276 |
+ if((ret = cli_ac_addsig(root, virname, hexsig, 0, 0, 0, rtype, type, 0, 0, offset, lsigid, options))) { |
|
277 | 277 |
cli_errmsg("cli_parse_add(): Problem adding signature (3).\n"); |
278 | 278 |
return ret; |
279 | 279 |
} |