From 54afbfa8e373bb7e5806efb13cf5073acab85720 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Sun, 13 Jan 2013 21:03:40 +0100 Subject: [PATCH] fixing a possible segfault in OP_LOAD_V --- prvm_execprogram.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/prvm_execprogram.h b/prvm_execprogram.h index 39f2cacb..393a7826 100644 --- a/prvm_execprogram.h +++ b/prvm_execprogram.h @@ -256,9 +256,10 @@ goto cleanup; } ed = PRVM_PROG_TO_EDICT(OPA->edict); - OPC->ivector[0] = ((prvm_eval_t *)(ed->fields.ip + OPB->_int))->ivector[0]; - OPC->ivector[1] = ((prvm_eval_t *)(ed->fields.ip + OPB->_int))->ivector[1]; - OPC->ivector[2] = ((prvm_eval_t *)(ed->fields.ip + OPB->_int))->ivector[2]; + ptr = ((prvm_eval_t *)(ed->fields.ip + OPB->_int)); + OPC->ivector[0] = ptr->ivector[0]; + OPC->ivector[1] = ptr->ivector[1]; + OPC->ivector[2] = ptr->ivector[2]; break; //================== -- 2.39.2