From 1cd301548a9bafe0ba477041bfdfbc9421627f69 Mon Sep 17 00:00:00 2001 From: Jeremy Rand Date: Wed, 30 Dec 2020 00:01:58 -0500 Subject: [PATCH] Validate the magic number and the version of the settings file. For now, I am not trying to handle backwards compatibility of settings file but it will be possible to do that in the future. --- BuGS/main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/BuGS/main.c b/BuGS/main.c index 24f5133..c7d25d0 100644 --- a/BuGS/main.c +++ b/BuGS/main.c @@ -289,6 +289,16 @@ BOOLEAN loadSettings(void) } HUnlock(filenameHandle); + if (success) + { + if ((settings.magic[0] != 'B') || + (settings.magic[1] != 'u') || + (settings.magic[2] != 'G') || + (settings.magic[3] != 'S') || + (settings.version != 0)) + success = FALSE; + } + return success; }