From 96be705631b4ed8a6bc98c8d2c0f1fc73e4a0807 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Tue, 22 Dec 2009 19:37:37 +0100 Subject: [PATCH] Perform a sanity check when loading keyboard.cfg. --- src/CConfig.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/CConfig.cpp b/src/CConfig.cpp index 5507f0f..aea5dc3 100644 --- a/src/CConfig.cpp +++ b/src/CConfig.cpp @@ -152,6 +152,15 @@ bool Config::loadKeyConfig() fclose(fp); return false; } + + for (int i = 0; i < CONTROL::MAX; i++) + { + if (keyboard.control[i] < 0 || keyboard.control[i] >= 350) + { + fclose(fp); + return false; + } + } fclose(fp); -- 2.39.5