...
|
...
|
@@ -257,7 +257,11 @@ int client(const struct optstruct *opts, int *infected, int *err)
|
257
|
257
|
if(scandash) {
|
258
|
258
|
int sockd, ret;
|
259
|
259
|
STATBUF sb;
|
260
|
|
- FSTAT(0, &sb);
|
|
260
|
+ if(FSTAT(0, &sb) < 0) {
|
|
261
|
+ logg("client.c: fstat failed for file name \"%s\", with %s\n.",
|
|
262
|
+ opts->filename[0], strerror(errno));
|
|
263
|
+ return 2;
|
|
264
|
+ }
|
261
|
265
|
if((sb.st_mode & S_IFMT) != S_IFREG) scantype = STREAM;
|
262
|
266
|
if((sockd = dconnect()) >= 0 && (ret = dsresult(sockd, scantype, NULL, &ret, NULL)) >= 0)
|
263
|
267
|
*infected = ret;
|