From dffc52bad545084a53b20f892ebf51d1d7c7fa78 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Thu, 1 Oct 2009 23:55:52 +0200 Subject: Prevent loading malformed panel tabs Remove all tabs if any tabinfo element doesn't match or we have just one tab --- UConfig.pas | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/UConfig.pas b/UConfig.pas index 5500093..edaac1b 100644 --- a/UConfig.pas +++ b/UConfig.pas @@ -896,6 +896,12 @@ begin j := IniFile.ReadInteger(Section, Format('Tab%d_SortType', [i]), 0); TabSortTypes.Add(Pointer(j)); end; + if (TabList.Count <> TabSortIDs.Count) or (TabList.Count <> TabSortTypes.Count) or (TabList.Count = 1) then begin + // Something went wrong, tab list is corrupt, let's remove all tabs + TabList.Clear; + TabSortIDs.Clear; + TabSortTypes.Clear; + end; finally try IniFile.Free; except end; end; -- cgit v1.2.3