[Pkg-clamav-commits] [SCM] Debian repository for ClamAV branch, debian/unstable, updated. 99ae9353f6834da0cb73f59f4b32d1f0ae1263fa

Stephen Gran steve at lobefin.net
Thu Sep 4 12:37:10 UTC 2008


The following commit has been merged in the debian/unstable branch:
commit 52e022907143dfa5d8ee6e4cc78c1dab21368e24
Author: Stephen Gran <steve at lobefin.net>
Date:   Thu Sep 4 13:25:57 2008 +0100

    Revert "always check return value of cli_gentemp()"
    
    This reverts commit 09143f41df5aa79314399627c1cacc8a305bd127.

diff --git a/ChangeLog b/ChangeLog
index bca55d7..2b5fe7e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,3 @@
-Thu Mar  6 20:24:54 CET 2008 (tk)
----------------------------------
-  * libclamav: always check return value of cli_gentemp()
-
 Mon Mar  3 19:46:41 CET 2008 (tk)
 ---------------------------------
   * V 0.93rc1
diff --git a/libclamav/cvd.c b/libclamav/cvd.c
index b76f820..416988c 100644
--- a/libclamav/cvd.c
+++ b/libclamav/cvd.c
@@ -514,9 +514,7 @@ int cli_cvdload(FILE *fs, struct cl_engine **engine, unsigned int *signo, short
 
     } else {
 
-	if(!(dir = cli_gentemp(NULL)))
-	    return CL_EMEM;
-
+	dir = cli_gentemp(NULL);
 	if(mkdir(dir, 0700)) {
 	    cli_errmsg("cli_cvdload(): Can't create temporary directory %s\n", dir);
 	    free(dir);
diff --git a/libclamav/htmlnorm.c b/libclamav/htmlnorm.c
index 01dbf78..a0f1016 100644
--- a/libclamav/htmlnorm.c
+++ b/libclamav/htmlnorm.c
@@ -1377,10 +1377,6 @@ static int cli_html_normalise(int fd, m_area_t *m_area, const char *dirname, tag
 					}
 					snprintf(filename, 1024, "%s/rfc2397", dirname);
 					tmp_file = cli_gentemp(filename);
-					if(!tmp_file) {
-						free(file_tmp_o1);
-						goto abort;
-					}
 					cli_dbgmsg("RFC2397 data file: %s\n", tmp_file);
 					file_tmp_o1->fd = open(tmp_file, O_WRONLY|O_CREAT|O_TRUNC, S_IWUSR|S_IRUSR);
 					free(tmp_file);
diff --git a/libclamav/rtf.c b/libclamav/rtf.c
index bfa0a93..72bf5b3 100644
--- a/libclamav/rtf.c
+++ b/libclamav/rtf.c
@@ -533,8 +533,7 @@ int cli_scanrtf(int desc, cli_ctx *ctx)
 		return CL_EMEM;
 	}
 
-	if(!(tempname = cli_gentemp(NULL)))
-	    return CL_EMEM;
+	tempname = cli_gentemp(NULL);
 
 	if(mkdir(tempname, 0700)) {
 	    	cli_dbgmsg("ScanRTF -> Can't create temporary directory %s\n", tempname);
diff --git a/libclamav/scanners.c b/libclamav/scanners.c
index 8b6c18d..18b4ae3 100644
--- a/libclamav/scanners.c
+++ b/libclamav/scanners.c
@@ -275,9 +275,7 @@ static int cli_scanrar(int desc, cli_ctx *ctx, off_t sfx_offset, uint32_t *sfx_c
 	    return CL_EIO;
 
     /* generate the temporary directory */
-    if(!(dir = cli_gentemp(NULL)))
-	return CL_EMEM;
-
+    dir = cli_gentemp(NULL);
     if(mkdir(dir, 0700)) {
 	cli_dbgmsg("RAR: Can't create temporary directory %s\n", dir);
 	free(dir);
@@ -376,9 +374,7 @@ static int cli_scanarj(int desc, cli_ctx *ctx, off_t sfx_offset, uint32_t *sfx_c
     cli_dbgmsg("in cli_scanarj()\n");
 
      /* generate the temporary directory */
-    if(!(dir = cli_gentemp(NULL)))
-	return CL_EMEM;
-
+    dir = cli_gentemp(NULL);
     if(mkdir(dir, 0700)) {
 	cli_dbgmsg("ARJ: Can't create temporary directory %s\n", dir);
 	free(dir);
@@ -690,10 +686,7 @@ static int cli_scanmscab(int desc, cli_ctx *ctx, off_t sfx_offset)
 	if(cli_checklimits("CAB", ctx, file->length, 0, 0)!=CL_CLEAN)
 	    continue;
 
-	if(!(tempname = cli_gentemp(NULL))) {
-	    ret = CL_EMEM;
-	    break;
-	}
+	tempname = cli_gentemp(NULL);
 	cli_dbgmsg("CAB: Extracting file %s to %s, size %u\n", file->name, tempname, file->length);
 	if((ret = cab_extract(file, tempname)))
 	    cli_dbgmsg("CAB: Failed to extract file: %s\n", cl_strerror(ret));
@@ -909,9 +902,7 @@ static int cli_scanhtml(int desc, cli_ctx *ctx)
 	return CL_CLEAN;
     }
 
-    if(!(tempname = cli_gentemp(NULL)))
-	return CL_EMEM;
-
+    tempname = cli_gentemp(NULL);
     if(mkdir(tempname, 0700)) {
         cli_errmsg("cli_scanhtml: Can't create temporary directory %s\n", tempname);
 	free(tempname);
@@ -1030,9 +1021,7 @@ static int cli_scanhtml_utf16(int desc, cli_ctx *ctx)
 
     cli_dbgmsg("in cli_scanhtml_utf16()\n");
 
-    if(!(tempname = cli_gentemp(NULL)))
-	return CL_EMEM;
-
+    tempname = cli_gentemp(NULL);
     if((fd = open(tempname, O_RDWR|O_CREAT|O_TRUNC|O_BINARY, S_IRWXU)) < 0) {
 	cli_errmsg("cli_scanhtml_utf16: Can't create file %s\n", tempname);
 	free(tempname);
@@ -1080,9 +1069,7 @@ static int cli_scanole2(int desc, cli_ctx *ctx)
         return CL_EMAXREC;
 
     /* generate the temporary directory */
-    if(!(dir = cli_gentemp(NULL)))
-	return CL_EMEM;
-
+    dir = cli_gentemp(NULL);
     if(mkdir(dir, 0700)) {
 	cli_dbgmsg("OLE2: Can't create temporary directory %s\n", dir);
 	free(dir);
@@ -1123,9 +1110,7 @@ static int cli_scantar(int desc, cli_ctx *ctx, unsigned int posix)
     cli_dbgmsg("in cli_scantar()\n");
 
     /* generate temporary directory */
-    if(!(dir = cli_gentemp(NULL)))
-	return CL_EMEM;
-
+    dir = cli_gentemp(NULL);
     if(mkdir(dir, 0700)) {
 	cli_errmsg("Tar: Can't create temporary directory %s\n", dir);
 	free(dir);
@@ -1150,8 +1135,7 @@ static int cli_scanbinhex(int desc, cli_ctx *ctx)
     cli_dbgmsg("in cli_scanbinhex()\n");
 
     /* generate temporary directory */
-    if(!(dir = cli_gentemp(NULL)))
-	return CL_EMEM;
+    dir = cli_gentemp(NULL);
 
     if(mkdir(dir, 0700)) {
 	cli_errmsg("Binhex: Can't create temporary directory %s\n", dir);
@@ -1180,9 +1164,7 @@ static int cli_scanmschm(int desc, cli_ctx *ctx)
     cli_dbgmsg("in cli_scanmschm()\n");
 
      /* generate the temporary directory */
-    if(!(dir = cli_gentemp(NULL)))
-	return CL_EMEM;
-
+    dir = cli_gentemp(NULL);
     if(mkdir(dir, 0700)) {
 	cli_dbgmsg("CHM: Can't create temporary directory %s\n", dir);
 	free(dir);
@@ -1238,9 +1220,7 @@ static int cli_scanscrenc(int desc, cli_ctx *ctx)
 
     cli_dbgmsg("in cli_scanscrenc()\n");
 
-    if(!(tempname = cli_gentemp(NULL)))
-	return CL_EMEM;
-
+    tempname = cli_gentemp(NULL);
     if(mkdir(tempname, 0700)) {
 	cli_dbgmsg("CHM: Can't create temporary directory %s\n", tempname);
 	free(tempname);
@@ -1326,11 +1306,7 @@ static int cli_scancryptff(int desc, cli_ctx *ctx)
 
     free(src);
 
-    if(!(tempfile = cli_gentemp(NULL))) {
-	free(dest);
-	return CL_EMEM;
-    }
-
+    tempfile = cli_gentemp(NULL);
     if((ndesc = open(tempfile, O_RDWR|O_CREAT|O_TRUNC|O_BINARY, S_IRWXU)) < 0) {
 	cli_errmsg("CryptFF: Can't create file %s\n", tempfile);
 	free(dest);
@@ -1378,8 +1354,6 @@ static int cli_scanpdf(int desc, cli_ctx *ctx)
 	int ret;
 	char *dir = cli_gentemp(NULL);
 
-    if(!dir)
-	return CL_EMEM;
 
     if(mkdir(dir, 0700)) {
 	cli_dbgmsg("Can't create temporary directory for PDF file %s\n", dir);
@@ -1401,8 +1375,6 @@ static int cli_scantnef(int desc, cli_ctx *ctx)
 	int ret;
 	char *dir = cli_gentemp(NULL);
 
-    if(!dir)
-	return CL_EMEM;
 
     if(mkdir(dir, 0700)) {
 	cli_dbgmsg("Can't create temporary directory for tnef file %s\n", dir);
@@ -1427,9 +1399,6 @@ static int cli_scanuuencoded(int desc, cli_ctx *ctx)
 	int ret;
 	char *dir = cli_gentemp(NULL);
 
-    if(!dir)
-	return CL_EMEM;
-
     if(mkdir(dir, 0700)) {
 	cli_dbgmsg("Can't create temporary directory for uuencoded file %s\n", dir);
 	free(dir);
@@ -1457,9 +1426,7 @@ static int cli_scanmail(int desc, cli_ctx *ctx)
     cli_dbgmsg("Starting cli_scanmail(), recursion = %u\n", ctx->recursion);
 
     /* generate the temporary directory */
-    if(!(dir = cli_gentemp(NULL)))
-	return CL_EMEM;
-
+    dir = cli_gentemp(NULL);
     if(mkdir(dir, 0700)) {
 	cli_dbgmsg("Mail: Can't create temporary directory %s\n", dir);
 	free(dir);
diff --git a/libclamav/tnef.c b/libclamav/tnef.c
index 2184433..1b6d58e 100644
--- a/libclamav/tnef.c
+++ b/libclamav/tnef.c
@@ -181,15 +181,14 @@ cli_tnef(const char *dir, int desc)
 				 * email that's about to be deleted
 				 */
 				if(cli_debug_flag) {
-					int fout = -1;
+					int fout;
 					char *filename = cli_gentemp(NULL);
 					char buffer[BUFSIZ];
 
-					if(filename)
 #ifdef	O_BINARY
-						fout = open(filename, O_WRONLY|O_CREAT|O_EXCL|O_TRUNC|O_BINARY, 0600);
+					fout = open(filename, O_WRONLY|O_CREAT|O_EXCL|O_TRUNC|O_BINARY, 0600);
 #else
-						fout = open(filename, O_WRONLY|O_CREAT|O_EXCL|O_TRUNC, 0600);
+					fout = open(filename, O_WRONLY|O_CREAT|O_EXCL|O_TRUNC, 0600);
 #endif
 
 					if(fout >= 0) {

-- 
Debian repository for ClamAV



More information about the Pkg-clamav-commits mailing list