From c89f858b7373052f80781be1f25dd9fc070e292d Mon Sep 17 00:00:00 2001 From: Dennis Potman Date: Wed, 15 Apr 2020 20:36:05 +0200 Subject: [PATCH] Fix memory leak that can occur when decoding rtps message with origin authentication being used Signed-off-by: Dennis Potman --- src/core/ddsi/src/ddsi_security_omg.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/ddsi/src/ddsi_security_omg.c b/src/core/ddsi/src/ddsi_security_omg.c index fce2dbf..aae4ebf 100644 --- a/src/core/ddsi/src/ddsi_security_omg.c +++ b/src/core/ddsi/src/ddsi_security_omg.c @@ -3248,7 +3248,10 @@ static bool q_omg_security_decode_rtps_message (struct proxy_participant *proxyp if (!sc->crypto_context->crypto_transform->decode_rtps_message (sc->crypto_context->crypto_transform, &plain_buffer, &encoded_buffer, pm->pp_crypto_handle, proxypp->sec_attr->crypto_handle, &ex)) { if (ex.code == DDS_SECURITY_ERR_INVALID_CRYPTO_RECEIVER_SIGN_CODE) + { + DDS_Security_Exception_reset (&ex); continue; /* Could be caused by 'with_origin_authentication' being used, so try next match */ + } GVTRACE ("decoding rtps message from remote participant "PGUIDFMT" failed: %s\n", PGUID (proxypp->e.guid), ex.message ? ex.message : "Unknown error"); DDS_Security_Exception_reset (&ex); ddsrt_mutex_unlock (&proxypp->sec_attr->lock);