[iortcw] 170/497: All: Guard against out-of-bounds jump table targets

Simon McVittie smcv at debian.org
Fri Sep 8 10:36:45 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to annotated tag 1.42d
in repository iortcw.

commit a24de7881bdba7dcdc81be97259c924abfb32db4
Author: M4N4T4RMS at gmail.com <M4N4T4RMS at gmail.com@e65d2741-a53d-b2dc-ae96-bb75fa5e4c4a>
Date:   Fri Aug 1 17:47:57 2014 +0000

    All: Guard against out-of-bounds jump table targets
---
 MP/code/qcommon/vm_x86.c | 3 ++-
 SP/code/qcommon/vm_x86.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/MP/code/qcommon/vm_x86.c b/MP/code/qcommon/vm_x86.c
index b896883..77aba05 100644
--- a/MP/code/qcommon/vm_x86.c
+++ b/MP/code/qcommon/vm_x86.c
@@ -1087,8 +1087,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
diff --git a/SP/code/qcommon/vm_x86.c b/SP/code/qcommon/vm_x86.c
index b896883..77aba05 100644
--- a/SP/code/qcommon/vm_x86.c
+++ b/SP/code/qcommon/vm_x86.c
@@ -1087,8 +1087,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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git



More information about the Pkg-games-commits mailing list