Fix ASAN build error 34/233634/1
authorDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 18 May 2020 03:58:22 +0000 (12:58 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 18 May 2020 03:58:22 +0000 (12:58 +0900)
This patchset resolves 'stringop-truncation' build
error for ASAN

Change-Id: If01bdf1441b15517c52476d047bbc3803ae9c7e1
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
src/bluetooth-adapter.c

index e570ad5..8e66609 100644 (file)
@@ -2738,7 +2738,7 @@ static void __bt_adapter_le_convert_scan_filter(
        if (src->device_name) {
                dest->added_features |= BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_NAME;
                strncpy(dest->device_name, src->device_name,
-                               BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX);
+                               BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX - 1);
                dest->device_name[BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX - 1] = '\0';
        }