X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=postlicyd%2Fconfig.c;h=b563ef3a30ca7bb90dff787021878f3d239bd1a4;hb=bcd90daa5d3d303afe13832249fa20cad7303f8c;hp=0bd69e2b115c2a9742f77eb8add360d9b3191a2c;hpb=9fc48ba2176a71585c13cd346968bdba499e80de;p=apps%2Fpfixtools.git diff --git a/postlicyd/config.c b/postlicyd/config.c index 0bd69e2..b563ef3 100644 --- a/postlicyd/config.c +++ b/postlicyd/config.c @@ -111,6 +111,9 @@ static bool config_second_pass(config_t *config) if (!ok) { return false; } + if (!filter_check_safety(&config->filters)) { + return false; + } ok = false; foreach (filter_param_t *param, config->params) { @@ -264,6 +267,9 @@ config_t *config_read(const char *file) if (escaped) { \ ADD_IN_BUFFER(Buffer, Len, '\\'); \ } \ + while ((Len) > 0 && isspace((Buffer)[(Len) - 1])) { \ + (Buffer)[--(Len)] = '\0'; \ + } \ } \ READ_NEXT(OnEOF); \ } while(0) @@ -298,7 +304,8 @@ read_param_value: filter_param_t param; param.type = param_tokenize(key, key_len); if (param.type != ATK_UNKNOWN) { - param.value = m_strdup(value); + param.value = p_dupstr(value, value_len); + param.value_len = value_len; array_add(config->params, param); } }