From: DoHyun Pyun Date: Thu, 13 May 2021 02:40:01 +0000 (+0900) Subject: Fix the crash issue in FHub product X-Git-Tag: accepted/tizen/unified/20210607.124412~4 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git;a=commitdiff_plain;h=816e1381aff64c34e7c6f87c50219a0519932b32 Fix the crash issue in FHub product 0xb60d394a in print_bt_properties (num_properties=1, properties=0xbe2d1160) at /usr/src/debug/bluetooth-frwk-0.6.0/bt-oal/common/oal-utils.c:205 i = __func__ = "print_bt_properties" Backtrace stopped: Cannot access memory at address 0x2d6c6166 Change-Id: I3dcbafb6ffd1b10a6db41f03df8658653e1d0b27 Signed-off-by: DoHyun Pyun --- diff --git a/bt-oal/common/oal-utils.c b/bt-oal/common/oal-utils.c index ee48297..19249da 100644 --- a/bt-oal/common/oal-utils.c +++ b/bt-oal/common/oal-utils.c @@ -206,8 +206,14 @@ void print_bt_properties(int num_properties, bt_property_t *properties) int i; for (i = 0; i < num_properties; i++) { bt_property_t prop; - memcpy(&prop, properties + i, sizeof(prop)); + + prop.type = properties[i].type; + prop.len = properties[i].len; + prop.val = g_memdup(properties[i].val, prop.len); + BT_DBG("prop: %s", convert_bt_property_2_str(&prop)); + + g_free(prop.val); } }