From: Wootak Jung Date: Wed, 28 Dec 2022 04:45:11 +0000 (+0900) Subject: [Bluetooth] Fix overflow issue (#4872) X-Git-Tag: submit/tizen_7.0/20221228.150958~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=130545687177972de8ba22eacb4c21ae1be55d05;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [Bluetooth] Fix overflow issue (#4872) --- diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothLeAdapterImpl.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothLeAdapterImpl.cs index 77ea945..890c80e 100644 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothLeAdapterImpl.cs +++ b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothLeAdapterImpl.cs @@ -337,7 +337,7 @@ namespace Tizen.Network.Bluetooth int sizePointerToABC = Marshal.SizeOf(new BluetoothLeServiceDataStruct()); for (int i = 0; i < _serviceListCount; i++) { - var svc = (BluetoothLeServiceDataStruct)Marshal.PtrToStructure(new IntPtr(serviceListArray.ToInt32() + (i * sizePointerToABC)), typeof(BluetoothLeServiceDataStruct)); + var svc = (BluetoothLeServiceDataStruct)Marshal.PtrToStructure(IntPtr.Add(serviceListArray, (i * sizePointerToABC)), typeof(BluetoothLeServiceDataStruct)); list.Add(BluetoothUtils.ConvertStructToLeServiceData(svc)); }