From cd0652d51ffc7002a7d159ec06b5ca6e41191ea7 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Tue, 27 Sep 2022 02:08:15 +0000 Subject: [PATCH] Fix static analysis issue This patch fixes 'use after free' case. The bundle instance is moved using std::move(). Change-Id: I3e00efdb42038c1a324e3a687678829e6a5b3eaa Signed-off-by: Hwankyu Jhun --- src/app_com.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app_com.cc b/src/app_com.cc index 6b78bf7..307534b 100644 --- a/src/app_com.cc +++ b/src/app_com.cc @@ -326,8 +326,8 @@ extern "C" API int aul_app_com_send(const char* endpoint, bundle* envelope) { .With(std::move(b)) .SendSimply(); if (type != BUNDLE_TYPE_NONE) { - b.Delete(AUL_K_COM_ENDPOINT); - b.Add(AUL_K_COM_ENDPOINT, com_endpoint); + bundle_del(envelope, AUL_K_COM_ENDPOINT); + bundle_add_str(envelope, AUL_K_COM_ENDPOINT, com_endpoint.c_str()); } return ret; -- 2.7.4