From 99683f0e7d63700d7ee49c1a4140b4cca76a1d8d Mon Sep 17 00:00:00 2001 From: Edoardo Prezioso Date: Thu, 16 Jul 2015 19:43:30 +0200 Subject: [PATCH] - Fixed a KEYCONF parser issue with empty lines. The code attempted to access an array outside its bounds when it tried to parse empty lines. Discovered with the Address Sanitizer. --- src/keysections.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/keysections.cpp b/src/keysections.cpp index 8d23c9582..1ae87958c 100644 --- a/src/keysections.cpp +++ b/src/keysections.cpp @@ -177,6 +177,11 @@ void D_LoadWadSettings () { cmd[i] = conf[i]; } + if (i == 0) + { + conf++; + continue; + } cmd[i] = 0; conf += i; if (*conf == '\n')