[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:22:00 UTC 2010
The following commit has been merged in the debian/unstable branch:
commit 020ba3ce4dcd0cf5173d3810783325cc34419f04
Author: Tomasz Kojm <tkojm at clamav.net>
Date: Fri Mar 5 22:01:48 2010 +0100
libclamav: fix scanning of utf16 data (bb#1853)
diff --git a/ChangeLog b/ChangeLog
index 019f656..f2b048a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Fri Mar 5 22:01:20 CET 2010 (tk)
+---------------------------------
+ * libclamav: fix scanning of utf16 data (bb#1853)
+
Fri Mar 5 21:14:12 CET 2010 (tk)
---------------------------------
* libclamav/matcher-bm.c: properly handle scan boundaries in
diff --git a/libclamav/filetypes.c b/libclamav/filetypes.c
index 88a6d5b..b992d4c 100644
--- a/libclamav/filetypes.c
+++ b/libclamav/filetypes.c
@@ -186,7 +186,7 @@ cli_file_t cli_filetype2(fmap_t *map, const struct cl_engine *engine)
decoded = (unsigned char *) cli_utf16toascii((char *) buff, bread);
if(decoded) {
- sret = cli_ac_scanbuff(decoded, strlen((char *) decoded), NULL, NULL, NULL, engine->root[0], &mdata, 0, CL_TYPE_TEXT_ASCII, NULL, AC_SCAN_FT, NULL);
+ sret = cli_ac_scanbuff(decoded, bread / 2, NULL, NULL, NULL, engine->root[0], &mdata, 0, CL_TYPE_TEXT_ASCII, NULL, AC_SCAN_FT, NULL);
free(decoded);
if(sret == CL_TYPE_HTML)
ret = CL_TYPE_HTML_UTF16;
diff --git a/libclamav/scanners.c b/libclamav/scanners.c
index d8b3185..370b610 100644
--- a/libclamav/scanners.c
+++ b/libclamav/scanners.c
@@ -1138,7 +1138,7 @@ static int cli_scanhtml_utf16(cli_ctx *ctx)
at += bytes;
decoded = cli_utf16toascii(buff, bytes);
if(decoded) {
- if(write(fd, decoded, strlen(decoded)) == -1) {
+ if(write(fd, decoded, bytes / 2) == -1) {
cli_errmsg("cli_scanhtml_utf16: Can't write to file %s\n", tempname);
free(decoded);
close(fd);
--
Debian repository for ClamAV
More information about the Pkg-clamav-commits
mailing list