From 82fc017ed31654475f9ecc0c003c0b5c27dac01d Mon Sep 17 00:00:00 2001 From: Michel Hidalgo Date: Tue, 7 Jul 2020 10:50:16 -0300 Subject: [PATCH] Amend rmw_init() implementation: require enclave. (#406) Signed-off-by: Michel Hidalgo --- rmw_fastrtps_cpp/src/rmw_init.cpp | 4 ++++ rmw_fastrtps_dynamic_cpp/src/rmw_init.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/rmw_fastrtps_cpp/src/rmw_init.cpp b/rmw_fastrtps_cpp/src/rmw_init.cpp index e621b5b6e..e9908ca61 100644 --- a/rmw_fastrtps_cpp/src/rmw_init.cpp +++ b/rmw_fastrtps_cpp/src/rmw_init.cpp @@ -84,6 +84,10 @@ rmw_init(const rmw_init_options_t * options, rmw_context_t * context) options->implementation_identifier, eprosima_fastrtps_identifier, return RMW_RET_INCORRECT_RMW_IMPLEMENTATION); + RMW_CHECK_FOR_NULL_WITH_MSG( + options->enclave, + "expected non-null enclave", + return RMW_RET_INVALID_ARGUMENT); if (NULL != context->implementation_identifier) { RMW_SET_ERROR_MSG("expected a zero-initialized context"); return RMW_RET_INVALID_ARGUMENT; diff --git a/rmw_fastrtps_dynamic_cpp/src/rmw_init.cpp b/rmw_fastrtps_dynamic_cpp/src/rmw_init.cpp index a5a35143d..46566e203 100644 --- a/rmw_fastrtps_dynamic_cpp/src/rmw_init.cpp +++ b/rmw_fastrtps_dynamic_cpp/src/rmw_init.cpp @@ -84,6 +84,10 @@ rmw_init(const rmw_init_options_t * options, rmw_context_t * context) options->implementation_identifier, eprosima_fastrtps_identifier, return RMW_RET_INCORRECT_RMW_IMPLEMENTATION); + RMW_CHECK_FOR_NULL_WITH_MSG( + options->enclave, + "expected non-null enclave", + return RMW_RET_INVALID_ARGUMENT); if (NULL != context->implementation_identifier) { RMW_SET_ERROR_MSG("expected a zero-initialized context"); return RMW_RET_INVALID_ARGUMENT;