summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2019-09-10 18:42:09 +0200
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-09-30 15:22:20 +0000
commitc811c43606014d6034e704036415d6f254a4a0bd (patch)
tree2a90430d81d2b57a24949d7a3373557b821da3ad /src
parentbda5886239e8f3e38827d4584f27b4c591d2acce (diff)
quic: fix non-null terminated hostname string
Type: fix Change-Id: I089d359d5726050f32f69366547086216fdb3098 Signed-off-by: Benoît Ganne <bganne@cisco.com> (cherry picked from commit b840c773dc9d7f0f9f85753a20d00acb53a6bce7)
Diffstat (limited to 'src')
-rw-r--r--src/plugins/quic/quic.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/plugins/quic/quic.c b/src/plugins/quic/quic.c
index 42a839db515..4a465fcbe30 100644
--- a/src/plugins/quic/quic.c
+++ b/src/plugins/quic/quic.c
@@ -1085,16 +1085,12 @@ quic_connect_new_connection (session_endpoint_cfg_t * sep)
ctx->client_opaque = sep->opaque;
ctx->c_flags |= TRANSPORT_CONNECTION_F_NO_LOOKUP;
if (sep->hostname)
- {
- ctx->srv_hostname = format (0, "%v", sep->hostname);
- vec_terminate_c_string (ctx->srv_hostname);
- }
+ ctx->srv_hostname = format (0, "%v", sep->hostname);
else
- {
- /* needed by quic for crypto + determining client / server */
- ctx->srv_hostname =
- format (0, "%U", format_ip46_address, &sep->ip, sep->is_ip4);
- }
+ /* needed by quic for crypto + determining client / server */
+ ctx->srv_hostname =
+ format (0, "%U", format_ip46_address, &sep->ip, sep->is_ip4);
+ vec_terminate_c_string (ctx->srv_hostname);
clib_memcpy (&cargs->sep, sep, sizeof (session_endpoint_cfg_t));
cargs->sep.transport_proto = TRANSPORT_PROTO_UDPC;