git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@670 77e5149b-7576-45b1-b177-96237e5ba77b
Tomasz Kojm authored on 2004/07/14 20:35:38... | ... |
@@ -300,9 +300,10 @@ int cli_scanbuff(const char *buffer, unsigned int length, const char **virname, |
300 | 300 |
if(++partcnt[pt->sigid] == pt->parts) { /* the last one */ |
301 | 301 |
if(pt->type) { |
302 | 302 |
if(typerec) { |
303 |
- cli_dbgmsg("Matched signature for file type: %s\n", pt->virname); |
|
304 |
- if(pt->type > type) |
|
303 |
+ if(pt->type > type) { |
|
304 |
+ cli_dbgmsg("Matched signature for file type: %s\n", pt->virname); |
|
305 | 305 |
type = pt->type; |
306 |
+ } |
|
306 | 307 |
} |
307 | 308 |
} else { |
308 | 309 |
if(virname) |
... | ... |
@@ -317,8 +318,11 @@ int cli_scanbuff(const char *buffer, unsigned int length, const char **virname, |
317 | 317 |
} else { /* old type signature */ |
318 | 318 |
if(pt->type) { |
319 | 319 |
if(typerec) { |
320 |
- cli_dbgmsg("Matched signature for file type: %s\n", pt->virname); |
|
321 |
- type = pt->type; |
|
320 |
+ if(pt->type > type) { |
|
321 |
+ cli_dbgmsg("Matched signature for file type: %s\n", pt->virname); |
|
322 |
+ |
|
323 |
+ type = pt->type; |
|
324 |
+ } |
|
322 | 325 |
} |
323 | 326 |
} else { |
324 | 327 |
if(virname) |
... | ... |
@@ -89,7 +89,7 @@ static int cli_addsig(struct cl_node *root, const char *virname, const char *hex |
89 | 89 |
*start++ = 0; |
90 | 90 |
|
91 | 91 |
new->alt++; |
92 |
- new->altn = (unsigned short int *) realloc(new->altn, new->alt); |
|
92 |
+ new->altn = (unsigned short int *) realloc(new->altn, new->alt * sizeof(unsigned short int)); |
|
93 | 93 |
new->altn[new->alt - 1] = 0; |
94 | 94 |
new->altc = (char **) realloc(new->altc, new->alt); |
95 | 95 |
|