From 8c011c1f949d9fc72cb3dc70b9a6629f7789b872 Mon Sep 17 00:00:00 2001 From: divverent Date: Thu, 5 Mar 2015 10:48:29 +0000 Subject: [PATCH] Fix an overrun in altstr_prepare. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12193 d7cf8633-e32d-0410-b094-e92efae38249 --- prvm_cmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prvm_cmds.c b/prvm_cmds.c index 187930b2..160327ff 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -4435,7 +4435,7 @@ void VM_altstr_prepare(prvm_prog_t *prog) instr = PRVM_G_STRING( OFS_PARM0 ); for( out = outstr, in = instr, size = sizeof(outstr) - 1 ; size && *in ; size--, in++, out++ ) - if( *in == '\'' ) { + if( *in == '\'' && size > 1) { *out++ = '\\'; *out = '\''; size--; -- 2.39.2