From a8d6ea0d5c3b86a756df9c902f91cbcc490449da Mon Sep 17 00:00:00 2001 From: Tapan Shah Date: Wed, 5 Aug 2015 00:53:10 +0000 Subject: [PATCH] ShellPkg: Fix 'drivers' assert issue for a driver name longer than 35 characters. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tapan Shah Reviewed-by: Chris Phillips Reviewed-by: Qiu Shumin git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18157 6f19259b-4bc3-4df7-8a09-765794883524 --- ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c index 06bd351519..d6d75f0625 100644 --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c @@ -282,7 +282,7 @@ ShellCommandRunDrivers ( TruncatedDriverName = NULL; if (!SfoFlag && (FullDriverName != NULL)) { TruncatedDriverName = AllocateZeroPool ((MAX_LEN_DRIVER_NAME + 1) * sizeof (CHAR16)); - StrCpyS (TruncatedDriverName, MAX_LEN_DRIVER_NAME + 1, FullDriverName); + StrnCpyS (TruncatedDriverName, MAX_LEN_DRIVER_NAME + 1, FullDriverName, MAX_LEN_DRIVER_NAME); } ShellPrintEx(