Browse code

clamdscan: fix parsing of virus names in extended mode (bb#2311)

Tomasz Kojm authored on 2010/10/11 20:49:44
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Mon Oct 11 13:49:29 CEST 2010 (tk)
2
+----------------------------------
3
+ * clamdscan: fix parsing of virus names in extended mode (bb#2311)
4
+
1 5
 Fri Oct  8 15:38:56 CEST 2010 (tk)
2 6
 ----------------------------------
3 7
  * clamscan/manager.c: return errors for stdin scan failures (bb#2317)
... ...
@@ -316,11 +316,12 @@ int dsresult(int sockd, int scantype, const char *filename, int *printok, int *e
316 316
 	if(len > 7) {
317 317
 	    char *colon = strrchr(bol, ':');
318 318
 	    if(colon && colon[1] != ' ') {
319
-		char *colon2;
319
+		char *br;
320 320
 		*colon = 0;
321
-		colon2 = strrchr(bol, ':');
322
-		*colon = ':';
323
-		colon = colon2;
321
+		br = strrchr(bol, '(');
322
+		if(br)
323
+		    *br = 0;
324
+		colon = strrchr(bol, ':');
324 325
 	    }
325 326
 	    if(!colon) {
326 327
 		logg("Failed to parse reply\n");
... ...
@@ -330,10 +331,10 @@ int dsresult(int sockd, int scantype, const char *filename, int *printok, int *e
330 330
 		infected++;
331 331
 		if(filename) {
332 332
 		    if(scantype >= STREAM) {
333
-			logg("~%s%s\n", filename, colon);
333
+			logg("~%s%s FOUND\n", filename, colon);
334 334
 			if(action) action(filename);
335 335
 		    } else {
336
-			logg("~%s\n", bol);
336
+			logg("~%s FOUND\n", bol);
337 337
 			*colon = '\0';
338 338
 			if(action)
339 339
 			    action(bol);