summaryrefslogtreecommitdiff
path: root/UConfig.pas
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2009-10-01 23:55:52 +0200
committerTomas Bzatek <tbzatek@users.sourceforge.net>2009-10-01 23:55:52 +0200
commitdffc52bad545084a53b20f892ebf51d1d7c7fa78 (patch)
treea958b98391aa0b275dafa56d59ff18f9661975cf /UConfig.pas
parent140ab8b26adefd427fedfc32aadf46f47f7f4019 (diff)
downloadtuxcmd-dffc52bad545084a53b20f892ebf51d1d7c7fa78.tar.xz
Prevent loading malformed panel tabs
Remove all tabs if any tabinfo element doesn't match or we have just one tab
Diffstat (limited to 'UConfig.pas')
-rw-r--r--UConfig.pas6
1 files changed, 6 insertions, 0 deletions
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;