Revision: 18059
          http://sourceforge.net/p/edk2/code/18059
Author:   jljusten
Date:     2015-07-26 08:06:01 +0000 (Sun, 26 Jul 2015)
Log Message:
-----------
ShellPkg: Fix the ASSERT issue in Shell 'for' loop

The Length 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 <jaben.car...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin....@intel.com>
Reviewed-by: Jaben Carsey <jaben.car...@intel.com>
[ler...@redhat.com: updated commit message as requested by Jaben]
Signed-off-by: Laszlo Ersek <ler...@redhat.com>

Modified Paths:
--------------
    trunk/edk2/ShellPkg/Application/Shell/ShellParametersProtocol.c

Modified: trunk/edk2/ShellPkg/Application/Shell/ShellParametersProtocol.c
===================================================================
--- trunk/edk2/ShellPkg/Application/Shell/ShellParametersProtocol.c     
2015-07-26 08:04:10 UTC (rev 18058)
+++ trunk/edk2/ShellPkg/Application/Shell/ShellParametersProtocol.c     
2015-07-26 08:06:01 UTC (rev 18059)
@@ -125,7 +125,7 @@
     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


------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
edk2-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to