summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author/dev/humancontroller <devhc@example.com>2014-07-21 17:43:53 +0200
committerTim Angus <tim@ngus.net>2014-08-28 11:13:04 +0100
commit6f6faa4cb4a2be5fc0a30125e44f6dcd74509fd4 (patch)
treea448621cbdc03c0661d41076d4f876f0ae62085b
parentfd05b04a2713d72b14e1c3def1ab44c4af796440 (diff)
guard against out-of-bounds jump table targets
-rw-r--r--src/qcommon/vm_x86.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qcommon/vm_x86.c b/src/qcommon/vm_x86.c
index 3650cc8c..b6fc6a63 100644
--- a/src/qcommon/vm_x86.c
+++ b/src/qcommon/vm_x86.c
@@ -1088,8 +1088,9 @@ void VM_Compile(vm_t *vm, vmHeader_t *header)
// ensure that the optimisation pass knows about all the jump
// table targets
+ pc = -1; // a bogus value to be printed in out-of-bounds error messages
for( i = 0; i < vm->numJumpTableTargets; i++ ) {
- jused[ *(int *)(vm->jumpTableTargets + ( i * sizeof( int ) ) ) ] = 1;
+ JUSED( *(int *)(vm->jumpTableTargets + ( i * sizeof( int ) ) ) );
}
// Start buffer with x86-VM specific procedures