handle error conditions of cli_scandesc()

git-svn: trunk@1070
remotes/push_mirror/metadata
Tomasz Kojm 21 years ago
parent e75e1ad1bf
commit 3862f7e1c2
  1. 4
      clamav-devel/ChangeLog
  2. 33
      clamav-devel/libclamav/scanners.c

@ -1,3 +1,7 @@
Mon Nov 8 10:01:48 CET 2004 (tk)
---------------------------------
* libclamav/scanners.c: handle error conditions of cli_scandesc()
Sun Nov 7 16:42:10 GMT 2004 (njh)
----------------------------------
* libclamav/message.c: Handle paragraph 4 of RFC2231

@ -141,9 +141,13 @@ static int cli_scanrar(int desc, const char **virname, long int *scanned, const
files++;
cli_dbgmsg("RAR: Encrypted files found in archive.\n");
lseek(desc, 0, SEEK_SET);
if(cli_scandesc(desc, virname, scanned, root, 0, 0) != CL_VIRUS)
ret = cli_scandesc(desc, virname, scanned, root, 0, 0);
if(ret < 0) {
break;
} else if(ret != CL_VIRUS) {
*virname = "Encrypted.RAR";
ret = CL_VIRUS;
ret = CL_VIRUS;
}
break;
}
@ -332,9 +336,13 @@ static int cli_scanzip(int desc, const char **virname, long int *scanned, const
files++;
cli_dbgmsg("Zip: Encrypted files found in archive.\n");
lseek(desc, 0, SEEK_SET);
if(cli_scandesc(desc, virname, scanned, root, 0, 0) != CL_VIRUS)
ret = cli_scandesc(desc, virname, scanned, root, 0, 0);
if(ret < 0) {
break;
} else if(ret != CL_VIRUS) {
*virname = "Encrypted.Zip";
ret = CL_VIRUS;
ret = CL_VIRUS;
}
break;
}
@ -728,6 +736,13 @@ static int cli_scanhtml(int desc, const char **virname, long int *scanned, const
close(fd);
}
if(ret < 0 || ret == CL_VIRUS) {
if(!cli_leavetemps_flag)
cli_rmdirs(tempname);
free(tempname);
return ret;
}
if (ret == CL_CLEAN) {
snprintf(fullname, 1024, "%s/nocomment.html", tempname);
fd = open(fullname, O_RDONLY);
@ -737,6 +752,13 @@ static int cli_scanhtml(int desc, const char **virname, long int *scanned, const
}
}
if(ret < 0 || ret == CL_VIRUS) {
if(!cli_leavetemps_flag)
cli_rmdirs(tempname);
free(tempname);
return ret;
}
if (ret == CL_CLEAN) {
snprintf(fullname, 1024, "%s/script.html", tempname);
fd = open(fullname, O_RDONLY);
@ -1280,6 +1302,9 @@ int cli_magic_scandesc(int desc, const char **virname, long int *scanned, const
cli_dbgmsg("%s found in descriptor %d.\n", *virname, desc);
return CL_VIRUS;
} else if(nret < 0) {
return nret;
} else if(nret >= CL_TYPENO) {
lseek(desc, 0, SEEK_SET);

Loading…
Cancel
Save