From e26259d758f3bc948fa6b2571d50a5944d94e9f0 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sat, 30 Jun 2018 19:12:56 +0200 Subject: [PATCH] GUI: Fix null pointer dereference in mass add When looking for duplicates if the detected game had an unknown platform or an unknown language, the string for the corresponding code is null, resulting in a null pointer dereference. --- gui/massadd.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gui/massadd.cpp b/gui/massadd.cpp index 8bc5a107209..66a1a23423f 100644 --- a/gui/massadd.cpp +++ b/gui/massadd.cpp @@ -209,8 +209,8 @@ void MassAddDialog::handleTickle() { // Check for existing config entries for this path/gameid/lang/platform combination if (_pathToTargets.contains(path)) { - const char *resultPlatformCode = Common::getPlatformCode(result.platform); - const char *resultLanguageCode = Common::getLanguageCode(result.language); + Common::String resultPlatformCode = Common::getPlatformCode(result.platform); + Common::String resultLanguageCode = Common::getLanguageCode(result.language); bool duplicate = false; const StringArray &targets = _pathToTargets[path];