summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/preferences/preferences_defaults.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/preferences/preferences_defaults.cpp')
-rw-r--r--desktop-widgets/preferences/preferences_defaults.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/desktop-widgets/preferences/preferences_defaults.cpp b/desktop-widgets/preferences/preferences_defaults.cpp
index 4500ecac2..e0a24530a 100644
--- a/desktop-widgets/preferences/preferences_defaults.cpp
+++ b/desktop-widgets/preferences/preferences_defaults.cpp
@@ -52,7 +52,7 @@ void PreferencesDefaults::refreshSettings()
ui->localDefaultFile->setChecked(prefs.default_file_behavior == LOCAL_DEFAULT_FILE);
ui->default_cylinder->clear();
- for (int i = 0; tank_info[i].name != NULL; i++) {
+ for (int i = 0; tank_info[i].name != NULL && i < MAX_TANK_INFO; i++) {
ui->default_cylinder->addItem(tank_info[i].name);
if (prefs.default_cylinder && strcmp(tank_info[i].name, prefs.default_cylinder) == 0)
ui->default_cylinder->setCurrentIndex(i);