Reviewed-by: Ye Ting <ting...@intel.com> 

-----Original Message-----
From: Zhang, Lubo 
Sent: Wednesday, July 08, 2015 5:30 PM
To: edk2-devel@lists.sourceforge.net; Ye, Ting; Fu, Siyuan; Hai, Yue A
Subject: [patch] MdemodulePkg: fix the problem that data type conversion may 
loss data

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zh...@intel.com>
---
 MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c 
b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c
index 9ac6363..fce80d2 100644
--- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c
+++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c
@@ -326,15 +326,15 @@ Mtftp4SendRequest (
   Len -= ((UINT32) AsciiStrLen ((CHAR8 *) Token->Filename) + (UINT32) 
AsciiStrLen ((CHAR8 *) Mode) + 4);
 
   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);
 }
 
-- 
1.9.5.msysgit.1



------------------------------------------------------------------------------
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-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to