mirror of https://github.com/acidanthera/audk.git
ShellPkg/TftpDynamicCommand: Fix the potentially uninitialized local variable used.
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1217 Local variable 'Mtftp4Token' might be uninitialized when error happen. This patch is to resolve the issue. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Carsey Jaben <jaben.carsey@intel.com> Cc: Zeng Star <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
parent
cf320090fa
commit
61d3f1000e
|
@ -936,6 +936,8 @@ DownloadFile (
|
||||||
UINT8 BlksizeBuf[10];
|
UINT8 BlksizeBuf[10];
|
||||||
UINT8 WindowsizeBuf[10];
|
UINT8 WindowsizeBuf[10];
|
||||||
|
|
||||||
|
ZeroMem (&Mtftp4Token, sizeof (EFI_MTFTP4_TOKEN));
|
||||||
|
|
||||||
// Downloaded file can be large. BS.AllocatePages() is more faster
|
// Downloaded file can be large. BS.AllocatePages() is more faster
|
||||||
// than AllocatePool() and avoid fragmentation.
|
// than AllocatePool() and avoid fragmentation.
|
||||||
// The downloaded file could be an EFI application. Marking the
|
// The downloaded file could be an EFI application. Marking the
|
||||||
|
@ -961,7 +963,6 @@ DownloadFile (
|
||||||
TftpContext->DownloadedNbOfBytes = 0;
|
TftpContext->DownloadedNbOfBytes = 0;
|
||||||
TftpContext->LastReportedNbOfBytes = 0;
|
TftpContext->LastReportedNbOfBytes = 0;
|
||||||
|
|
||||||
ZeroMem (&Mtftp4Token, sizeof (EFI_MTFTP4_TOKEN));
|
|
||||||
Mtftp4Token.Filename = (UINT8*)AsciiFilePath;
|
Mtftp4Token.Filename = (UINT8*)AsciiFilePath;
|
||||||
Mtftp4Token.BufferSize = FileSize;
|
Mtftp4Token.BufferSize = FileSize;
|
||||||
Mtftp4Token.Buffer = Buffer;
|
Mtftp4Token.Buffer = Buffer;
|
||||||
|
|
Loading…
Reference in New Issue