[Bluetooth] Fix the invalid array index issue (#666)
authordh79pyun <31202060+dh79pyun@users.noreply.github.com>
Thu, 17 Jan 2019 04:27:32 +0000 (13:27 +0900)
committerGitHub <noreply@github.com>
Thu, 17 Jan 2019 04:27:32 +0000 (13:27 +0900)
src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothLeAdapter.cs

index 91ca0ff..ded75cd 100644 (file)
@@ -794,7 +794,7 @@ namespace Tizen.Network.Bluetooth {
                 serviceDataPtr = Marshal.AllocHGlobal(data.DataLength);
                 Marshal.Copy(data.Data, 0, serviceDataPtr, data.DataLength);
 
-                for (int i = 0; i < 3; i++)
+                for (int i = 0; i < data.DataLength; i++)
                     Log.Error (Globals.LogTag, " service data is  " + data.Data [i]);
                 int ret = Interop.Bluetooth.AddAdvertisingServiceData(GetHandle(), packetType,
                     data.Uuid, serviceDataPtr, data.DataLength);