From bd021b109c0e6f755eef3ce025a6aa9ec8a140f5 Mon Sep 17 00:00:00 2001 From: smallmodel <15067410+smallmodel@users.noreply.github.com> Date: Wed, 18 Dec 2024 19:31:21 +0100 Subject: [PATCH] Fix a terrible mistake in TIKI_FindTiki with uninitialized variable This was using an uninitialized buffer to find the cached TIKI, in most configurations it always returned false, but when compiled with GCC it would return true --- code/tiki/tiki_cache.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/tiki/tiki_cache.cpp b/code/tiki/tiki_cache.cpp index 7a68ea15..34ba05a2 100644 --- a/code/tiki/tiki_cache.cpp +++ b/code/tiki/tiki_cache.cpp @@ -83,6 +83,9 @@ dtiki_t *TIKI_FindTiki(const char *path) if (tikicache) { dtiki_t **t; + Q_strncpyz(filename, path, sizeof(filename)); + FS_CanonicalFilename(filename); + t = tikicache->find(filename); if (t) { return *t;