]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
ssl_common.h: fix 'not all control paths return a value' msvc warning
authorLev Stipakov <lev@openvpn.net>
Thu, 17 Dec 2020 22:48:34 +0000 (00:48 +0200)
committerGert Doering <gert@greenie.muc.de>
Sun, 20 Dec 2020 20:07:26 +0000 (21:07 +0100)
Commit cc5a71637 ("Replace key_scan array of static pointers with inline
function") has introduced get_key_scan() routine with switch statement
which calls ASSERT() in the default case.

Even though "this should never happen", this code triggers Level 1 warning
"not all control paths return a value" in msvc.

Fix by adding "return NULL; /* NOTREACHED */" after ASSERT.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20201217224834.160-1-lstipakov@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg21373.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/ssl_common.h

index f435089a4c579db651ceb7ef1db6e24562d76638..a826e37f7547916848ba549e4c7b7ffba45bcf8c 100644 (file)
@@ -596,6 +596,7 @@ get_key_scan(struct tls_multi *multi, int index)
             return &multi->session[TM_LAME_DUCK].key[KS_LAME_DUCK];
         default:
             ASSERT(false);
+            return NULL; /* NOTREACHED */
     }
 }