summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhang Lubo <lubo.zhang@intel.com>2015-07-08 09:49:41 +0000
committerluobozhang <luobozhang@Edk2>2015-07-08 09:49:41 +0000
commite0f74cea66e64e8f12462fce4f6580800592417a (patch)
tree5fede6e656094461b8d6519f965728d4568ad781
parent01267e224b8f3247e3b360851f6781be6bb80129 (diff)
downloadedk2-platforms-e0f74cea66e64e8f12462fce4f6580800592417a.tar.xz
fix the problem that data type conversion may loss data.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17886 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c
index cfb4b26df2..647fe64e50 100644
--- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c
+++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c
@@ -328,11 +328,11 @@ Mtftp4SendRequest (
for (Index = 0; Index < Token->OptionCount; ++Index) {
Cur = (UINT8 *) AsciiStrCpyS ((CHAR8 *) Cur, Len, (CHAR8 *) Options[Index].OptionStr);
Cur += AsciiStrLen ((CHAR8 *) Options[Index].OptionStr) + 1;
- Len -= (AsciiStrLen ((CHAR8 *) Options[Index].OptionStr) + 1);
+ Len -= (UINT32) AsciiStrLen ((CHAR8 *) Options[Index].OptionStr) + 1;
Cur = (UINT8 *) AsciiStrCpyS ((CHAR8 *) Cur, Len, (CHAR8 *) Options[Index].ValueStr);
Cur += AsciiStrLen ((CHAR8 *) (CHAR8 *) Options[Index].ValueStr) + 1;
- Len -= (AsciiStrLen ((CHAR8 *) (CHAR8 *) Options[Index].ValueStr) + 1);
+ Len -= (UINT32) AsciiStrLen ((CHAR8 *) (CHAR8 *) Options[Index].ValueStr) + 1;
}
return Mtftp4SendPacket (Instance, Nbuf);