[iortcw] 89/497: Fix Game VM's trap_GetTag crashing when CGame is a QVM
Simon McVittie
smcv at debian.org
Fri Sep 8 10:36:31 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 662cba02474651fa7297148f0a81d1e59e655330
Author: ZTurtleMan at gmail.com <ZTurtleMan at gmail.com@e65d2741-a53d-b2dc-ae96-bb75fa5e4c4a>
Date: Sun Apr 27 04:52:38 2014 +0000
Fix Game VM's trap_GetTag crashing when CGame is a QVM
---
MP/code/client/cl_cgame.c | 3 ++-
SP/code/client/cl_cgame.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/MP/code/client/cl_cgame.c b/MP/code/client/cl_cgame.c
index 187062a..37a2484 100644
--- a/MP/code/client/cl_cgame.c
+++ b/MP/code/client/cl_cgame.c
@@ -1419,7 +1419,8 @@ qboolean CL_GetTag( int clientNum, char *tagname, orientation_t *or ) {
foundTag = VM_Call( cgvm, CG_GET_TAG, clientNum, cgTagname, cgOr );
// copy result back to game memory and free temp in reverse order
- VM_FreeTempMemory( cgvm, cgTagname, MAX_QPATH, tagname );
+ // tagname isn't copied back because it might be a static string.
+ VM_FreeTempMemory( cgvm, cgTagname, MAX_QPATH, NULL );
VM_FreeTempMemory( cgvm, cgOr, sizeof (orientation_t), or );
return foundTag;
diff --git a/SP/code/client/cl_cgame.c b/SP/code/client/cl_cgame.c
index d7c86f2..6eb4c98 100644
--- a/SP/code/client/cl_cgame.c
+++ b/SP/code/client/cl_cgame.c
@@ -1353,7 +1353,8 @@ qboolean CL_GetTag( int clientNum, char *tagname, orientation_t *or ) {
foundTag = VM_Call( cgvm, CG_GET_TAG, clientNum, cgTagname, cgOr );
// copy result back to game memory and free temp in reverse order
- VM_FreeTempMemory( cgvm, cgTagname, MAX_QPATH, tagname );
+ // tagname isn't copied back because it might be a static string.
+ VM_FreeTempMemory( cgvm, cgTagname, MAX_QPATH, NULL );
VM_FreeTempMemory( cgvm, cgOr, sizeof (orientation_t), or );
return foundTag;
--
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