Can you update the comment to just say "Length" instead of "The 3rd parameter of 'GetNextParameter'"... the variable name is visible in the change, the 3rd parameter of a function is not.
Reviewed-by: Jaben Carsey <[email protected]> > -----Original Message----- > From: Qiu, Shumin > Sent: Wednesday, July 22, 2015 12:41 AM > To: [email protected] > Cc: Qiu, Shumin <[email protected]>; Carsey, Jaben > <[email protected]> > Subject: [PATCH] ShellPkg: Fix the ASSERT issue in Shell 'for' loop > Importance: High > > The 3rd parameter of 'GetNextParameter' is the buffer size in bytes. While > StrnCpys requires user to pass the max number of dest unicode char, we > should convert size in bytes to the number of char. > > Cc: Jaben Carsey <[email protected]> > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Qiu Shumin<[email protected]> > --- > ShellPkg/Application/Shell/ShellParametersProtocol.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/ShellPkg/Application/Shell/ShellParametersProtocol.c > b/ShellPkg/Application/Shell/ShellParametersProtocol.c > index de29c25..1c1367b 100644 > --- a/ShellPkg/Application/Shell/ShellParametersProtocol.c > +++ b/ShellPkg/Application/Shell/ShellParametersProtocol.c > @@ -125,7 +125,7 @@ DEBUG_CODE_END(); > return (EFI_NOT_FOUND); > } > > - StrnCpyS(*TempParameter, Length, (*Walker), NextDelim - *Walker); > + StrnCpyS(*TempParameter, Length / sizeof(CHAR16), (*Walker), > NextDelim - *Walker); > > // > // Add a CHAR_NULL if we didnt get one via the copy > -- > 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

