summaryrefslogtreecommitdiffstats
path: root/NetworkPkg/IScsiDxe
diff options
context:
space:
mode:
authorQiu Shumin <shumin.qiu@intel.com>2014-12-19 02:37:53 +0000
committershenshushi <shenshushi@Edk2>2014-12-19 02:37:53 +0000
commit3532030489e93e67703a3c3df53fd9dfdee68f97 (patch)
treeac6b17128cb76ce22a4728f383bd51b0854b1951 /NetworkPkg/IScsiDxe
parent6a497016c9f6aa60e9be330d1592f8b5e71156ef (diff)
downloadedk2-3532030489e93e67703a3c3df53fd9dfdee68f97.tar.gz
edk2-3532030489e93e67703a3c3df53fd9dfdee68f97.tar.bz2
edk2-3532030489e93e67703a3c3df53fd9dfdee68f97.zip
Code refine. Check the original length of array to avoid buffer over flow.
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
Diffstat (limited to 'NetworkPkg/IScsiDxe')
-rw-r--r--NetworkPkg/IScsiDxe/IScsiMisc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/NetworkPkg/IScsiDxe/IScsiMisc.c b/NetworkPkg/IScsiDxe/IScsiMisc.c
index 05f639aaee..aeb99e5f94 100644
--- a/NetworkPkg/IScsiDxe/IScsiMisc.c
+++ b/NetworkPkg/IScsiDxe/IScsiMisc.c
@@ -226,6 +226,7 @@ IScsiLunToUnicodeStr (
//
// Remove the last '-'
//
+ ASSERT (StrLen(Str) >= 1);
Str[StrLen (Str) - 1] = 0;
for (Index = StrLen (Str) - 1; Index > 1; Index = Index - 2) {