[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 00:56:40 UTC 2010


The following commit has been merged in the debian/unstable branch:
commit 957bf651430d44b82ddf227c2bce8bdb3ae80f9d
Author: Török Edvin <edwin at clamav.net>
Date:   Tue Jul 7 23:53:33 2009 +0300

    Check number of functions loaded.

diff --git a/libclamav/bytecode.c b/libclamav/bytecode.c
index 693590c..b32dce8 100644
--- a/libclamav/bytecode.c
+++ b/libclamav/bytecode.c
@@ -52,6 +52,7 @@ int cli_bytecode_context_clear(struct cli_bc_ctx *ctx)
     free(ctx->values);
     free(ctx->operands);
     memset(ctx, 0, sizeof(ctx));
+    return CL_SUCCESS;
 }
 
 int cli_bytecode_context_setfuncid(struct cli_bc_ctx *ctx, struct cli_bc *bc, unsigned funcid)
@@ -597,6 +598,11 @@ int cli_bytecode_load(struct cli_bc *bc, FILE *f, struct cli_dbio *dbio)
 	}
     }
     cli_dbgmsg("Parsed %d functions\n", current_func);
+    if (current_func != bc->num_func) {
+	cli_errmsg("Loaded less functions than declared: %u vs. %u\n",
+		   current_func, bc->num_func);
+	return CL_EMALFDB;
+    }
     return CL_SUCCESS;
 }
 
diff --git a/libclamav/bytecode_vm.c b/libclamav/bytecode_vm.c
index 706e717..9ae4805 100644
--- a/libclamav/bytecode_vm.c
+++ b/libclamav/bytecode_vm.c
@@ -42,7 +42,7 @@ static int bcfail(const char *msg, unsigned a, unsigned b,
     bcfail("funcid out of bounds!",funcid, bc->num_func,__FILE__,__LINE__); } while(0)
 #define CHECK_EQ(a, b) do { if (a != b) return \
     bcfail("Values "#a" and "#b" don't match!",a,b,__FILE__,__LINE__); } while(0)
-#define CHECK_GT(a, b) do {if (a < b) return \
+#define CHECK_GT(a, b) do {if (a <= b) return \
     bcfail("Condition failed "#a" > "#b,a,b, __FILE__, __LINE__); } while(0)
 #else
 #define CHECK_FUNCID(x)

-- 
Debian repository for ClamAV



More information about the Pkg-clamav-commits mailing list