From: Sebastian Harl Date: Tue, 16 Oct 2007 23:14:18 +0000 (+0200) Subject: perl plugin: Fixed handling of erroneous configuration options. X-Git-Tag: collectd-4.2.0~16 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6238d319b71ba9f7022bc1306fa10d92fd2fe747;p=collectd.git perl plugin: Fixed handling of erroneous configuration options. An empty block was used instead of returning from the perl_config_*() functions in case of an error. I wonder how that has happened... :-/ Signed-off-by: Sebastian Harl Signed-off-by: Florian Forster --- diff --git a/src/perl.c b/src/perl.c index c0beabfe..47844eb9 100644 --- a/src/perl.c +++ b/src/perl.c @@ -907,8 +907,8 @@ static int perl_config_loadplugin (oconfig_item_t *ci) char *value = NULL; if ((0 != ci->children_num) || (1 != ci->values_num) - || (OCONFIG_TYPE_STRING != ci->values[0].type)) { - } + || (OCONFIG_TYPE_STRING != ci->values[0].type)) + return 1; value = ci->values[0].value.string; @@ -934,8 +934,8 @@ static int perl_config_basename (oconfig_item_t *ci) char *value = NULL; if ((0 != ci->children_num) || (1 != ci->values_num) - || (OCONFIG_TYPE_STRING != ci->values[0].type)) { - } + || (OCONFIG_TYPE_STRING != ci->values[0].type)) + return 1; value = ci->values[0].value.string; @@ -953,8 +953,8 @@ static int perl_config_enabledebugger (oconfig_item_t *ci) char *value = NULL; if ((0 != ci->children_num) || (1 != ci->values_num) - || (OCONFIG_TYPE_STRING != ci->values[0].type)) { - } + || (OCONFIG_TYPE_STRING != ci->values[0].type)) + return 1; value = ci->values[0].value.string; @@ -987,8 +987,8 @@ static int perl_config_includedir (oconfig_item_t *ci) char *value = NULL; if ((0 != ci->children_num) || (1 != ci->values_num) - || (OCONFIG_TYPE_STRING != ci->values[0].type)) { - } + || (OCONFIG_TYPE_STRING != ci->values[0].type)) + return 1; value = ci->values[0].value.string;