summaryrefslogtreecommitdiffstats
path: root/NetworkPkg/UefiPxeBcDxe
diff options
context:
space:
mode:
authorJiaxin Wu <Jiaxin.wu@intel.com>2018-10-16 13:34:00 +0800
committerJiaxin Wu <Jiaxin.wu@intel.com>2018-10-22 09:04:56 +0800
commitddc6d41d128c57dec8e79a0ad1eae7a80ec0280b (patch)
treeccf5e5305eb4e87bbcb01c2e6efd2ca71a9457ab /NetworkPkg/UefiPxeBcDxe
parent1682cc9353ecf688aa928fa102280c1d807ba3c5 (diff)
downloadedk2-ddc6d41d128c57dec8e79a0ad1eae7a80ec0280b.tar.gz
edk2-ddc6d41d128c57dec8e79a0ad1eae7a80ec0280b.tar.bz2
edk2-ddc6d41d128c57dec8e79a0ad1eae7a80ec0280b.zip
NetworkPkg: Correct the time stamp and fix the integer overflow issue.
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=883. Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
Diffstat (limited to 'NetworkPkg/UefiPxeBcDxe')
-rw-r--r--NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c b/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c
index 60509fc9e6..7ab09e0367 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c
@@ -1510,14 +1510,14 @@ CalcElapsedTime (
//
ZeroMem (&Time, sizeof (EFI_TIME));
gRT->GetTime (&Time, NULL);
- CurrentStamp = (UINT64)
- (
- ((((((Time.Year - 1900) * 360 +
- (Time.Month - 1)) * 30 +
- (Time.Day - 1)) * 24 + Time.Hour) * 60 +
- Time.Minute) * 60 + Time.Second) * 100
- + DivU64x32(Time.Nanosecond, 10000000)
- );
+ CurrentStamp = MultU64x32 (
+ ((((UINT32)(Time.Year - 1900) * 360 + (Time.Month - 1) * 30 + (Time.Day - 1)) * 24 + Time.Hour) * 60 + Time.Minute) * 60 + Time.Second,
+ 100
+ ) +
+ DivU64x32 (
+ Time.Nanosecond,
+ 10000000
+ );
//
// Sentinel value of 0 means that this is the first DHCP packet that we are