From cc8990495aaafa4998c77260594727fcee285d0e Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Thu, 17 Sep 2009 09:42:05 +0000 Subject: [PATCH] * (bug #4282) Fix potential overlap of VM stack and bss sections (Patrick Baggett) --- code/qcommon/vm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/qcommon/vm.c b/code/qcommon/vm.c index a62377de..5360522f 100644 --- a/code/qcommon/vm.c +++ b/code/qcommon/vm.c @@ -423,7 +423,8 @@ vmHeader_t *VM_LoadQVM( vm_t *vm, qboolean alloc ) { // round up to next power of 2 so all data operations can // be mask protected - dataLength = header.h->dataLength + header.h->litLength + header.h->bssLength; + dataLength = header.h->dataLength + header.h->litLength + + header.h->bssLength + STACK_SIZE; for ( i = 0 ; dataLength > ( 1 << i ) ; i++ ) { } dataLength = 1 << i;