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: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6238d319b71ba9f7022bc1306fa10d92fd2fe747;p=thirdparty%2Fcollectd.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 c0beabfe5..47844eb95 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;