Fix the crash issue in FHub product 56/258256/1
authorDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 13 May 2021 02:40:01 +0000 (11:40 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 13 May 2021 02:40:01 +0000 (11:40 +0900)
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 = <optimized out>
        __func__ = "print_bt_properties"
Backtrace stopped: Cannot access memory at address 0x2d6c6166

Change-Id: I3dcbafb6ffd1b10a6db41f03df8658653e1d0b27
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
bt-oal/common/oal-utils.c

index ee48297..19249da 100644 (file)
@@ -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);
        }
 }