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

aCaB acab at clamav.net
Sun Apr 4 01:04:13 UTC 2010


The following commit has been merged in the debian/unstable branch:
commit 017bbfbf863edb7ba19c1769c834ebb93a051296
Author: aCaB <acab at clamav.net>
Date:   Sat Sep 5 17:27:36 2009 +0200

    fix cli_scanhtml_utf16

diff --git a/libclamav/macho.c b/libclamav/macho.c
index 4fe8846..c18083b 100644
--- a/libclamav/macho.c
+++ b/libclamav/macho.c
@@ -492,6 +492,7 @@ int cli_scanmacho(int fd, cli_ctx *ctx, struct cli_exe_info *fileinfo)
 
 int cli_machoheader(int fd, struct cli_exe_info *fileinfo)
 {
+return CL_EFORMAT; /* FIXMEFMAP: avoids crashing on machoes for now */
     return cli_scanmacho(fd, NULL, fileinfo);
 }
 
diff --git a/libclamav/scanners.c b/libclamav/scanners.c
index 7df1a43..1da6895 100644
--- a/libclamav/scanners.c
+++ b/libclamav/scanners.c
@@ -1089,13 +1089,14 @@ static int cli_scanhtml_utf16(cli_ctx *ctx)
     cli_dbgmsg("cli_scanhtml_utf16: using tempfile %s\n", tempname);
 
     while(at < map->len) {
-	bytes = map->len - at > map->pgsz * 16 ? map->pgsz * 16 : map->len - at;
+	bytes = MIN(map->len - at, map->pgsz * 16);
 	if(!(buff = fmap_need_off_once(map, at, bytes))) {
 	    close(fd);
 	    cli_unlink(tempname);
 	    free(tempname);
 	    return CL_EREAD;
 	}
+	at += bytes;
 	decoded = cli_utf16toascii(buff, bytes);
 	if(decoded) {
 	    if(write(fd, decoded, strlen(decoded)) == -1) {

-- 
Debian repository for ClamAV



More information about the Pkg-clamav-commits mailing list