X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=ShellPkg%2FApplication%2FShell%2FShellProtocol.c;h=991fb58ca70e3b6b53e2405b60ed710088b090ec;hp=b3b8acc0d01833c6e09fd4c661bf160ebe895ab2;hb=4f0465058b6ff9c53591ec81951f494a70bde7c1;hpb=1557f05b37f89d1f3cd41a5543a22533fc68ede6 diff --git a/ShellPkg/Application/Shell/ShellProtocol.c b/ShellPkg/Application/Shell/ShellProtocol.c index b3b8acc0d0..991fb58ca7 100644 --- a/ShellPkg/Application/Shell/ShellProtocol.c +++ b/ShellPkg/Application/Shell/ShellProtocol.c @@ -477,7 +477,7 @@ EfiShellGetFilePathFromDevicePath( // UEFI Shell spec section 3.7) if ((PathSize != 0) && (PathForReturn != NULL) && - (PathForReturn[PathSize - 1] != L'\\') && + (PathForReturn[PathSize / sizeof (CHAR16) - 1] != L'\\') && (AlignedNode->PathName[0] != L'\\')) { PathForReturn = StrnCatGrow (&PathForReturn, &PathSize, L"\\", 1); }