From 02ed74e6bdcfee32512c454e780663768903ba88 Mon Sep 17 00:00:00 2001 From: Erik Boasson Date: Wed, 6 May 2020 21:34:21 +0200 Subject: [PATCH] Fix conversion of user_data to security plugin The security plugins currently use the standardized representations of octet sequences, unlike the DDSI stack's internal representation. A shallow copy is therefore not simply a memcpy. Signed-off-by: Erik Boasson --- src/core/ddsi/src/ddsi_security_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/ddsi/src/ddsi_security_util.c b/src/core/ddsi/src/ddsi_security_util.c index 11f39b5..65959bc 100644 --- a/src/core/ddsi/src/ddsi_security_util.c +++ b/src/core/ddsi/src/ddsi_security_util.c @@ -517,7 +517,7 @@ q_omg_shallow_copy_ParticipantBuiltinTopicDataSecure( /* Copy the DDS_Security_OctetSeq content (length, pointer, etc), not the buffer content. */ if (plist->qos.present & QP_USER_DATA) - memcpy(&(dst->user_data.value), &(plist->qos.user_data.value), sizeof(DDS_Security_OctetSeq)); + g_omg_shallow_copy_octSeq(&dst->user_data.value, &plist->qos.user_data); /* Tokens are actually DataHolders. */ if (plist->present & PP_IDENTITY_TOKEN) q_omg_shallow_copyin_DataHolder(&(dst->identity_token), &(plist->identity_token));