public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: wzssyqa+uefi@gmail.com
To: devel@edk2.groups.io
Subject: [edk2-devel] EDK2-TEST/EMS: TimeStamp overflow
Date: Mon, 23 Sep 2024 19:10:00 -0700	[thread overview]
Message-ID: <Zyt8.1727143800583792278.sv7U@groups.io> (raw)

[-- Attachment #1: Type: text/plain, Size: 996 bytes --]

In file /edk2-test/uefi-sct/EMS/Src/EmsRpc/EmsRpcEth.c, there are line like:

GetSystemTime ( & Time);

FillCnlLlFlag (Packet, LastSendSeq, LINK_OPERATION_CLEANUP, 0 , FALSE );
TimeStamp += ((UINT64) Time. wYear * 12 * 31 * 24 * 60 * 60 );
TimeStamp += ((UINT64) Time. wMonth * 31 * 24 * 60 * 60 );
TimeStamp += ((UINT64) Time. wDay * 24 * 60 * 60 );
TimeStamp += ((UINT64) Time. wHour * 60 * 60 );
TimeStamp += ((UINT64) Time. wMinute * 60 );
TimeStamp += Time. wSecond ;
TimeStamp <<= 32 ;
TimeStamp += Time. wMilliseconds ;

The value of `2024*12*31*24*60*60` is 65052979200, which is out of the range of 32bit.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120578): https://edk2.groups.io/g/devel/message/120578
Mute This Topic: https://groups.io/mt/108622514/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 6645 bytes --]

                 reply	other threads:[~2024-09-24  3:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zyt8.1727143800583792278.sv7U@groups.io \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox