[Pkg-clamav-commits] [SCM] Debian repository for ClamAV branch, debian/unstable, updated. debian/0.95+dfsg-1-6156-g094ec9b

Tomasz Kojm tkojm at clamav.net
Sun Apr 4 01:03:05 UTC 2010


The following commit has been merged in the debian/unstable branch:
commit a4d5efb4fefed5361c21512e17e00d39f150cc69
Author: Tomasz Kojm <tkojm at clamav.net>
Date:   Mon Aug 31 11:19:53 2009 +0200

    fix fd check, thx aCaB

diff --git a/libclamav/matcher-ac.c b/libclamav/matcher-ac.c
index ad3fc13..3ac5abc 100644
--- a/libclamav/matcher-ac.c
+++ b/libclamav/matcher-ac.c
@@ -838,12 +838,14 @@ int cli_ac_caloff(const struct cli_matcher *root, struct cli_ac_data *data, int
 	struct cli_target_info info;
 	struct stat sb;
 
-    memset(&info, 0, sizeof(info));
-    if(fstat(fd, &sb) == -1) {
-	cli_errmsg("cli_ac_caloff: fstat(%d) failed\n", fd);
-	return CL_ESTAT;
+    if(fd != -1) {
+	memset(&info, 0, sizeof(info));
+	if(fstat(fd, &sb) == -1) {
+	    cli_errmsg("cli_ac_caloff: fstat(%d) failed\n", fd);
+	    return CL_ESTAT;
+	}
+	info.fsize = sb.st_size;
     }
-    info.fsize = sb.st_size;
 
     for(i = 0; i < root->ac_reloff_num; i++) {
 	patt = root->ac_reloff[i];
@@ -858,7 +860,7 @@ int cli_ac_caloff(const struct cli_matcher *root, struct cli_ac_data *data, int
 	    data->offset[patt->offset_min] = CLI_OFF_NONE;
 	}
     }
-    if(info.exeinfo.section)
+    if(fd != -1 && info.exeinfo.section)
 	free(info.exeinfo.section);
 
     return CL_SUCCESS;

-- 
Debian repository for ClamAV



More information about the Pkg-clamav-commits mailing list