From db0dd54c376eb25263059075e5103f0849ef2ffe Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 17 Jun 2018 23:28:44 +0200 Subject: Localization: make cache thread safe and robust against use-after-free The old trGettext() was not thread-safe and the returned C-strings could be freed in the case of empty translations strings. Therefore: 1) Introduce a mutex protecting access to the cache. 2) Never change existing entries, even if the translation string is empty. Signed-off-by: Berthold Stoeger --- desktop-widgets/mainwindow.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'desktop-widgets') diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 95efcca63..b22b7e265 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -14,6 +14,7 @@ #include #include +#include "core/gettextfromc.h" #include "core/version.h" #include "core/subsurface-string.h" #include "desktop-widgets/divelistview.h" -- cgit v1.2.3-70-g09d2