X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=ShellPkg%2FApplication%2FShell%2FShellParametersProtocol.c;h=8d76fb4be7ff0910d333b1814ed471a9e23099f1;hp=499915521aeec1f27d4dc66266453afd152424ff;hb=810c635d6f40e85040033819f971d03d0f707c1a;hpb=4333b99d283efa651386ef594a186b0252507df3 diff --git a/ShellPkg/Application/Shell/ShellParametersProtocol.c b/ShellPkg/Application/Shell/ShellParametersProtocol.c index 499915521a..8d76fb4be7 100644 --- a/ShellPkg/Application/Shell/ShellParametersProtocol.c +++ b/ShellPkg/Application/Shell/ShellParametersProtocol.c @@ -5,7 +5,7 @@ (C) Copyright 2016 Hewlett Packard Enterprise Development LP
Copyright (C) 2014, Red Hat, Inc. (C) Copyright 2013 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -1034,9 +1034,9 @@ UpdateStdInStdOutStdErr( StrnCpyS(CommandLineCopy, StrSize(CommandLineCopy)/sizeof(CHAR16), NewCommandLine, StrLen(NewCommandLine)); if (FirstLocation != CommandLineCopy + StrLen(CommandLineCopy) - && ((UINTN)(FirstLocation - CommandLineCopy) < StrLen(NewCommandLine)) + && (((UINTN)FirstLocation - (UINTN)CommandLineCopy)/sizeof(CHAR16) < StrLen(NewCommandLine)) ){ - *(NewCommandLine + (UINTN)(FirstLocation - CommandLineCopy)) = CHAR_NULL; + *(NewCommandLine + ((UINTN)FirstLocation - (UINTN)CommandLineCopy)/sizeof(CHAR16)) = CHAR_NULL; } if (!EFI_ERROR(Status)) {