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

Török Edvin edwin at clamav.net
Sun Apr 4 01:23:51 UTC 2010


The following commit has been merged in the debian/unstable branch:
commit 50436cbdb11e1d1e9d4b6ae6e7994791a36a4902
Author: Török Edvin <edwin at clamav.net>
Date:   Mon Mar 22 13:41:18 2010 +0200

    bytecode api fixes.

diff --git a/libclamav/bytecode_api.c b/libclamav/bytecode_api.c
index 5464377..5bf4e9f 100644
--- a/libclamav/bytecode_api.c
+++ b/libclamav/bytecode_api.c
@@ -295,10 +295,10 @@ static inline const char* cli_memmem(const char *haystack, unsigned hlen,
 	haystack = memchr(haystack, c, hlen - nlen + 1);
 	if (!haystack)
 	    return NULL;
+	hlen -= haystack+1 - p;
 	p = haystack + 1;
 	if (!memcmp(p, needle, nlen-1))
 	    return haystack;
-	hlen -= p - haystack;
 	haystack = p;
     }
     return NULL;
@@ -316,12 +316,12 @@ int32_t cli_bcapi_file_find(struct cli_bc_ctx *ctx, const uint8_t* data, uint32_
     for (;;) {
 	const char *p;
 	n = fmap_readn(map, buf, off, sizeof(buf));
-	if ((unsigned)n < len)
+	if ((unsigned)n < len || n < 0)
 	    return -1;
 	p = cli_memmem(buf, n, data, len);
 	if (p)
 	    return off + p - buf;
-	off += n-len;
+	off += n;
     }
     return -1;
 }
@@ -726,7 +726,7 @@ int32_t cli_bcapi_inflate_process(struct cli_bc_ctx *ctx , int32_t id)
     b->stream.next_out = cli_bcapi_buffer_pipe_write_get(ctx, b->to,
 							 b->stream.avail_out);
 
-    if (!b->stream.avail_in || !b->stream.avail_out)
+    if (!b->stream.avail_in || !b->stream.avail_out || !b->stream.next_in || !b->stream.next_out)
 	return -1;
     /* try hard to extract data, skipping over corrupted data */
     do {
diff --git a/shared/optparser.c b/shared/optparser.c
index 835e4bc..7a8670d 100644
--- a/shared/optparser.c
+++ b/shared/optparser.c
@@ -121,7 +121,6 @@ const struct clam_option __clam_options[] = {
     { NULL, "generate-config", 'g', TYPE_STRING, NULL, -1, NULL, 0, OPT_CLAMCONF, "", "" },
 
     { NULL, "force-interpreter", 'f', TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMBC, "Force using the interpreter instead of the JIT", "" },
-    { NULL, "trust-bytecode", 't', TYPE_BOOL, MATCH_BOOL, 1, NULL, 0, OPT_CLAMBC, "Trust loaded bytecode (default yes)", ""},
     { NULL, "bytecode-trust-all", 't', TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMSCAN, "Trust loaded bytecode (default: only if signed)", ""},
     { NULL, "info", 'i', TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMBC, "Load and print bytecode information without executing", ""},
     { NULL, "printsrc", 'p', TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMBC, "Print source code of bytecode", ""},

-- 
Debian repository for ClamAV



More information about the Pkg-clamav-commits mailing list