X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdePkg%2FLibrary%2FUefiDevicePathLib%2FDevicePathFromText.c;h=e5f6a1f0621ade9b4145fb82b14ce0d3062c9030;hp=b8966854b2f33110f4b2929e1edbc96b6d090a4a;hb=6252f2715af3f7d9d56980b1e0176ad069770e5f;hpb=624f017e1756338c89326bc2dd9a2ba07e4ec5bb diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c index b8966854b2..e5f6a1f062 100644 --- a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c +++ b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c @@ -2795,17 +2795,18 @@ DevPathFromTextBluetooth ( ); Index = sizeof (BLUETOOTH_ADDRESS) - 1; - while (!IS_NULL(BluetoothStr) && Index >= 0) { - Walker = SplitStr (&BluetoothStr, L':'); - TempBufferSize = StrSize (Walker) + StrLen (L"0x") * sizeof (CHAR16); + Walker = BluetoothStr; + while (!IS_NULL(*Walker) && Index >= 0) { + TempBufferSize = 2 * sizeof(CHAR16) + StrSize(L"0x"); TempNumBuffer = AllocateZeroPool (TempBufferSize); if (TempNumBuffer == NULL) { break; } StrCpyS (TempNumBuffer, TempBufferSize / sizeof (CHAR16), L"0x"); - StrCatS (TempNumBuffer, TempBufferSize / sizeof (CHAR16), Walker); + StrnCatS (TempNumBuffer, TempBufferSize / sizeof (CHAR16), Walker, 2); BluetoothDp->BD_ADDR.Address[Index] = (UINT8)Strtoi (TempNumBuffer); FreePool (TempNumBuffer); + Walker += 2; Index--; }