]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
vici: Remove unreachable code
authorTobias Brunner <tobias@strongswan.org>
Fri, 7 Sep 2018 09:17:06 +0000 (11:17 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 11 Sep 2018 16:18:50 +0000 (18:18 +0200)
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

index 13761f59d20b7594dbd95cac71d43e10d103da1e..df5b85c64c25ba701c1cdacaba4657661ad5bb66 100644 (file)
@@ -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;
 }