]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Code refine. Check the original length of array to avoid buffer over flow.
authorQiu Shumin <shumin.qiu@intel.com>
Fri, 19 Dec 2014 02:37:53 +0000 (02:37 +0000)
committershenshushi <shenshushi@Edk2>
Fri, 19 Dec 2014 02:37:53 +0000 (02:37 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16539 6f19259b-4bc3-4df7-8a09-765794883524

NetworkPkg/IScsiDxe/IScsiMisc.c

index 05f639aaeeb54fcbade7d66398de62755396dfad..aeb99e5f94ae8a3b4a4e19e5a139848579cac614 100644 (file)
@@ -226,6 +226,7 @@ IScsiLunToUnicodeStr (
   //\r
   // Remove the last '-'\r
   //\r
+  ASSERT (StrLen(Str) >= 1);\r
   Str[StrLen (Str) - 1] = 0;\r
 \r
   for (Index = StrLen (Str) - 1; Index > 1; Index = Index - 2) {\r