summaryrefslogtreecommitdiff
path: root/src/core/settings.c
diff options
context:
space:
mode:
authorJilles Tjoelker <jilles@irssi.org>2009-02-21 21:17:51 +0000
committerjilles <jilles@dbcabf3a-b0e7-0310-adc4-f8d773084564>2009-02-21 21:17:51 +0000
commitcb1f07352af92688983563998f9251ab20cac821 (patch)
tree9b01c36bec2240c4ba98f24bd5ed6a5a6ec60bd2 /src/core/settings.c
parent946e7784b00c9051013b996bd09dcaf144cf250c (diff)
downloadirssi-cb1f07352af92688983563998f9251ab20cac821.zip
Reject invalid level specifications in /set.
Most of these have names that end in "_level". git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5021 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core/settings.c')
-rw-r--r--src/core/settings.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core/settings.c b/src/core/settings.c
index cb196bd1..bfcead3e 100644
--- a/src/core/settings.c
+++ b/src/core/settings.c
@@ -134,7 +134,7 @@ int settings_get_level(const char *key)
const char *str;
str = settings_get_str_type(key, SETTING_TYPE_LEVEL);
- return str == NULL ? 0 : level2bits(str);
+ return str == NULL ? 0 : level2bits(str, NULL);
}
int settings_get_size(const char *key)
@@ -355,6 +355,12 @@ int settings_set_time(const char *key, const char *value)
int settings_set_level(const char *key, const char *value)
{
+ int iserror;
+
+ (void)level2bits(value, &iserror);
+ if (iserror)
+ return FALSE;
+
iconfig_node_set_str(settings_get_node(key), key, value);
return TRUE;
}