Browse code

update

git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@1939 77e5149b-7576-45b1-b177-96237e5ba77b

Tomasz Kojm authored on 2006/05/02 02:38:53
Showing 1 changed files
... ...
@@ -81,18 +81,27 @@ static int dsresult(int sockd, const struct optstruct *opt)
81 81
 	    infected++;
82 82
 	    logg("%s", buff);
83 83
 	    if(optl(opt, "move")) {
84
-		pt = strrchr(buff, ':');
85
-		*pt = 0;
86
-		move_infected(buff, opt);
84
+		/* filename: Virus FOUND */
85
+		if((pt = strrchr(buff, ':'))) {
86
+		    *pt = 0;
87
+		    move_infected(buff, opt);
88
+		} else {
89
+		    mprintf("@Broken data format. File not moved.\n");
90
+		}
87 91
 
88 92
 	    } else if(optl(opt, "remove")) {
89
-		pt = strrchr(buff, ':');
90
-		*pt = 0;
91
-		if(unlink(buff)) {
92
-		    logg("%s: Can't remove.\n", buff);
93
-		    notremoved++;
93
+		if(!(pt = strrchr(buff, ':'))) {
94
+		    mprintf("@Broken data format. File not removed.\n");
94 95
 		} else {
95
-		    logg("%s: Removed.\n", buff);
96
+		    *pt = 0;
97
+		    if(unlink(buff)) {
98
+			mprintf("%s: Can't remove.\n", buff);
99
+			logg("%s: Can't remove.\n", buff);
100
+			notremoved++;
101
+		    } else {
102
+			mprintf("%s: Removed.\n", buff);
103
+			logg("%s: Removed.\n", buff);
104
+		    }
96 105
 		}
97 106
 	    }
98 107
 	}