From 57c5a0da55d871df6a311ce9f847171995fc29e6 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Mon, 8 Nov 2021 09:37:44 +0000 Subject: [PATCH] jit-trust: SAN_RFC822_NAME needs other_name union member ->san is a union, in this case we set the type to indicate we use SAN_OTHER_NAME member, but set the unstructured_name union member, that is smaller. This doesn't cause any problem, since the union has space for it. But Coverity noticed, it is wrong, so fix it. --- lib/tls/mbedtls/mbedtls-extensions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tls/mbedtls/mbedtls-extensions.c b/lib/tls/mbedtls/mbedtls-extensions.c index 839563e57..dc406e826 100644 --- a/lib/tls/mbedtls/mbedtls-extensions.c +++ b/lib/tls/mbedtls/mbedtls-extensions.c @@ -258,7 +258,7 @@ lws_mbedtls_x509_parse_general_name(const mbedtls_x509_buf *name_buf, memset(name, 0, sizeof(*name)); name->type = LWS_MBEDTLS_X509_SAN_OTHER_NAME; - memcpy(&name->san.unstructured_name, + memcpy(&name->san.other_name, &rfc822Name, sizeof(rfc822Name)); return 0;