[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:25:24 UTC 2010


The following commit has been merged in the debian/unstable branch:
commit 50829fbf126237670165f587c4c84bf1c823cbd2
Author: Török Edvin <edwin at clamav.net>
Date:   Wed Mar 24 10:41:11 2010 +0200

    Fix read of pedata in interpreter.

diff --git a/libclamav/bytecode.c b/libclamav/bytecode.c
index 29834bd..527bbed 100644
--- a/libclamav/bytecode.c
+++ b/libclamav/bytecode.c
@@ -1669,7 +1669,7 @@ static int cli_bytecode_prepare_interpreter(struct cli_bc *bc)
 			}
 		    } else {
 			/* APIs have at most 2 parameters always */
-			if (inst->u.ops.numOps > 2) {
+			if (inst->u.ops.numOps > 5) {
 			    cli_errmsg("bytecode: call operands don't match function prototype\n");
 			    return CL_EBYTECODE;
 			}
diff --git a/libclamav/bytecode_vm.c b/libclamav/bytecode_vm.c
index 8590250..7b49f37 100644
--- a/libclamav/bytecode_vm.c
+++ b/libclamav/bytecode_vm.c
@@ -560,7 +560,7 @@ static unsigned globaltypesize(uint16_t id)
     const struct cli_bc_type *ty;
     if (id <= 64)
 	return (id + 7)/8;
-    if (id <= 69)
+    if (id < 69)
 	return 8; /* ptr */
     ty = &cli_apicall_types[id - 69];
     switch (ty->kind) {
@@ -770,6 +770,46 @@ int cli_vm_execute(const struct cli_bc *bc, struct cli_bc_ctx *ctx, const struct
 			res = cli_apicalls2[api->idx](ctx, a);
 			break;
 		    }
+		    case 3: {
+			int32_t a;
+			void *resp;
+			READ32(a, inst->u.ops.ops[0]);
+			resp = cli_apicalls3[api->idx](ctx, a);
+			res = ptr_register_glob(&ptrinfos, resp, a);
+			break;
+		    }
+		    case 4: {
+			int32_t arg2, arg3, arg4, arg5;
+			void *arg1;
+			READ32(arg2, inst->u.ops.ops[1]);
+			READP(arg1, inst->u.ops.ops[0], arg2);
+			READ32(arg3, inst->u.ops.ops[2]);
+			READ32(arg4, inst->u.ops.ops[3]);
+			READ32(arg5, inst->u.ops.ops[4]);
+			res = cli_apicalls4[api->idx](ctx, arg1, arg2, arg3, arg4, arg5);
+			break;
+		    }
+		    case 5: {
+			res = cli_apicalls5[api->idx](ctx);
+			break;
+		    }
+		    case 6: {
+			int32_t arg1, arg2;
+			void *resp;
+			READ32(arg1, inst->u.ops.ops[0]);
+			READ32(arg2, inst->u.ops.ops[1]);
+			resp = cli_apicalls6[api->idx](ctx, arg1, arg2);
+			res = ptr_register_glob(&ptrinfos, resp, arg2);
+			break;
+		    }
+		    case 7: {
+			int32_t arg1,arg2,arg3;
+			READ32(arg1, inst->u.ops.ops[0]);
+			READ32(arg2, inst->u.ops.ops[1]);
+			READ32(arg3, inst->u.ops.ops[2]);
+			res = cli_apicalls7[api->idx](ctx, arg1, arg2, arg3);
+			break;
+		    }
 		    default:
 			cli_errmsg("bytecode: type %u apicalls not yet implemented!\n", api->kind);
 			stop = CL_EBYTECODE;
diff --git a/libclamav/pe.h b/libclamav/pe.h
index 5e1b0a2..2f48303 100644
--- a/libclamav/pe.h
+++ b/libclamav/pe.h
@@ -140,8 +140,10 @@ struct cli_pe_hook_data {
   uint32_t offset;
   uint32_t ep;
   uint16_t nsections;
+  uint16_t dummy; /* align */
   struct pe_image_file_hdr file_hdr;
   struct pe_image_optional_hdr32 opt32;
+  uint32_t dummy2; /* align */
   struct pe_image_optional_hdr64 opt64;
   struct pe_image_data_dir dirs[16];
   uint32_t e_lfanew;/**< address of new exe header */
diff --git a/libclamav/type_desc.h b/libclamav/type_desc.h
index 0d4b6eb..7aa552a 100644
--- a/libclamav/type_desc.h
+++ b/libclamav/type_desc.h
@@ -45,7 +45,7 @@ typedef uint32_t (*cli_apicall_int2)(struct cli_bc_ctx *, uint32_t, uint32_t);
 typedef uint32_t (*cli_apicall_pointer)(struct cli_bc_ctx *, void*, uint32_t);
 typedef uint32_t (*cli_apicall_int1)(struct cli_bc_ctx *, uint32_t);
 typedef void* (*cli_apicall_malloclike)(struct cli_bc_ctx *, uint32_t);
-typedef void* (*cli_apicall_ptrbuffdata)(struct cli_bc_ctx *, void*, uint32_t, uint32_t, uint32_t, uint32_t);
+typedef int32_t (*cli_apicall_ptrbuffdata)(struct cli_bc_ctx *, void*, uint32_t, uint32_t, uint32_t, uint32_t);
 typedef int32_t (*cli_apicall_allocobj)(struct cli_bc_ctx *);
 typedef void* (*cli_apicall_bufget)(struct cli_bc_ctx *, int32_t, uint32_t);
 typedef int32_t (*cli_apicall_int3)(struct cli_bc_ctx *, int32_t, int32_t, int32_t);

-- 
Debian repository for ClamAV



More information about the Pkg-clamav-commits mailing list