Revision: 17795
          http://sourceforge.net/p/edk2/code/17795
Author:   shenshushi
Date:     2015-07-02 01:12:03 +0000 (Thu, 02 Jul 2015)
Log Message:
-----------
ShellPkg: Refine the code logic of StrnCatGrow.

In order to indicate the catena length use StrnCatS instead of StrCatS to 
generate Destination string, and update the DestMax of Destination string.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <[email protected]>
Reviewed-by: Tapan Shah <[email protected]>
Reviewed-by: Jaben Carsey <[email protected]>

Modified Paths:
--------------
    trunk/edk2/ShellPkg/Library/UefiShellLib/UefiShellLib.c

Modified: trunk/edk2/ShellPkg/Library/UefiShellLib/UefiShellLib.c
===================================================================
--- trunk/edk2/ShellPkg/Library/UefiShellLib/UefiShellLib.c     2015-07-02 
00:50:42 UTC (rev 17794)
+++ trunk/edk2/ShellPkg/Library/UefiShellLib/UefiShellLib.c     2015-07-02 
01:12:03 UTC (rev 17795)
@@ -3254,7 +3254,8 @@
       *CurrentSize = NewSize;
     }
   } else {
-    *Destination = AllocateZeroPool((Count+1)*sizeof(CHAR16));
+    NewSize = (Count+1)*sizeof(CHAR16);
+    *Destination = AllocateZeroPool(NewSize);
   }
 
   //
@@ -3264,7 +3265,7 @@
     return (NULL);
   }
   
-  StrCatS(*Destination, Count + 1, Source);
+  StrnCatS(*Destination, NewSize/sizeof(CHAR16), Source, Count);
   return *Destination;
 }
 


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to