]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
ShellPkg: Refine code to use Strn**S safe functions instead of Str**S ones in some...
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / SmbiosView / QueryTable.c
index dd878c4cb7fc2b4677001861464ea00e9d63f34c..759f486a3295cccfa2c90d4bf6cefd6cb608f0a0 100644 (file)
@@ -3229,8 +3229,8 @@ QueryTable (
     //\r
     if ((High > Low && Key >= Low && Key <= High) \r
       || (Table[Index].Key == Key)) {\r
-      StrCpyS (Info, InfoLen, Table[Index].Info);\r
-      StrCatS (Info, InfoLen, L"\n");\r
+      StrnCpyS (Info, InfoLen, Table[Index].Info, InfoLen - 1);\r
+      StrnCatS (Info, InfoLen, L"\n", InfoLen - 1 - StrLen(Info));\r
       return Key;\r
     }\r
   }\r