]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Fix an overrun in altstr_prepare.
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 5 Mar 2015 10:48:29 +0000 (10:48 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 5 Mar 2015 10:48:29 +0000 (10:48 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12193 d7cf8633-e32d-0410-b094-e92efae38249

prvm_cmds.c

index 187930b23835891bd0f4d881c252251d46b4966f..160327ff20c825600d9b2b5cffd4ad6c0ed4df69 100644 (file)
@@ -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--;