From a0c302f878e05ba86b7c87573c723f9e0bf5af38 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Fri, 7 Sep 2018 11:17:06 +0200 Subject: [PATCH] vici: Remove unreachable code If list is TRUE any type but VICI_LIST_END and VICI_LIST_ITEM (i.e. including VICI_END) is already handled in the first block in this function. --- src/libcharon/plugins/vici/vici_message.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/libcharon/plugins/vici/vici_message.c b/src/libcharon/plugins/vici/vici_message.c index 13761f59d..df5b85c64 100644 --- a/src/libcharon/plugins/vici/vici_message.c +++ b/src/libcharon/plugins/vici/vici_message.c @@ -102,18 +102,10 @@ bool vici_verify_type(vici_type_t type, u_int section, bool list) DBG1(DBG_ENC, "'%N' outside of section", vici_type_names, type); return FALSE; } - if (type == VICI_END) + if (type == VICI_END && section) { - if (section) - { - DBG1(DBG_ENC, "'%N' within section", vici_type_names, type); - return FALSE; - } - if (list) - { - DBG1(DBG_ENC, "'%N' within list", vici_type_names, type); - return FALSE; - } + DBG1(DBG_ENC, "'%N' within section", vici_type_names, type); + return FALSE; } return TRUE; }