]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
tests/unit_tests/openvpn/test_auth_token.c: handle strdup errors
authorIlia Shipitsin <chipitsine@gmail.com>
Mon, 8 Jul 2024 21:08:22 +0000 (23:08 +0200)
committerGert Doering <gert@greenie.muc.de>
Mon, 9 Sep 2024 07:30:22 +0000 (09:30 +0200)
Signed-off-by: Ilia Shipitsin <chipitsine@gmail.com>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Message-Id: <20240708210912.566-6-chipitsine@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg28882.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
tests/unit_tests/openvpn/test_auth_token.c

index 3a3cb69b5b00f0da93e65e37f621fc1ae29c8b5d..8a0c16af8be2ef1f75d77eefac2a88152aad4be2 100644 (file)
@@ -245,6 +245,7 @@ auth_token_test_known_keys(void **state)
     now = 0;
     /* Preload the session id so the same session id is used here */
     ctx->multi.auth_token_initial = strdup(now0key0);
+    assert_non_null(ctx->multi.auth_token_initial);
 
     /* Zero the hmac part to ensure we have a newly generated token */
     zerohmac(ctx->multi.auth_token_initial);
@@ -374,6 +375,7 @@ auth_token_test_random_keys(void **state)
     now = 0x5c331e9c;
     /* Preload the session id so the same session id is used here */
     ctx->multi.auth_token_initial = strdup(random_token);
+    assert_non_null(ctx->multi.auth_token_initial);
 
     free_key_ctx(&ctx->multi.opt.auth_token_key);
     auth_token_init_secret(&ctx->multi.opt.auth_token_key, random_key, true);