From 3df06cd519002107de28c715dfb56810a1cda94c Mon Sep 17 00:00:00 2001 From: Shpoike Date: Tue, 1 Oct 2024 03:42:03 +0100 Subject: [PATCH] qtv: strcpy with overlapping dest/source was resulting in serverinfo corruption with glibc. --- fteqtv/rcon.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fteqtv/rcon.c b/fteqtv/rcon.c index 7eb6597d4..b86e10100 100644 --- a/fteqtv/rcon.c +++ b/fteqtv/rcon.c @@ -161,7 +161,11 @@ void Info_RemoveKey (char *s, const char *key) if (!strcmp (key, pkey) ) { - strcpy (start, s); // remove this part + //strip out the value by copying the next string over the top of this one + //(we were using strcpy, but valgrind moans and glibc fucks it up. they should not overlap... so use our own crappy inefficient alternative) + while(*s) + *start++ = *s++; + *start = 0; return; }