diff options
| author | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2009-10-01 23:55:52 +0200 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2009-10-01 23:55:52 +0200 |
| commit | dffc52bad545084a53b20f892ebf51d1d7c7fa78 (patch) | |
| tree | a958b98391aa0b275dafa56d59ff18f9661975cf | |
| parent | 140ab8b26adefd427fedfc32aadf46f47f7f4019 (diff) | |
| download | tuxcmd-dffc52bad545084a53b20f892ebf51d1d7c7fa78.tar.xz | |
Prevent loading malformed panel tabs
Remove all tabs if any tabinfo element doesn't match or we have just one tab
| -rw-r--r-- | UConfig.pas | 6 |
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; |
