From 9f843fb4459ae3b93046af784df18937fca6fa9c Mon Sep 17 00:00:00 2001 From: helixhorned Date: Thu, 21 Feb 2013 18:53:42 +0000 Subject: [PATCH] CON qstrcpy: don't call strcpy() with identical source and destination quotes. Thus making the identical source and destination quote number case into the expected no-op instead of being undefined behavior. git-svn-id: https://svn.eduke32.com/eduke32@3510 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/gameexec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index 92f4eeebe..70d6017a2 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -1985,7 +1985,8 @@ skip_check: break; case CON_QSTRCPY: if ((ScriptQuotes[i] == NULL || ScriptQuotes[j] == NULL)) goto nullquote; - Bstrcpy(ScriptQuotes[i],ScriptQuotes[j]); + if (i != j) + Bstrcpy(ScriptQuotes[i],ScriptQuotes[j]); break; case CON_CHANGESPRITESECT: if ((unsigned)i >= MAXSPRITES)