summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal
diff options
context:
space:
mode:
authorFu Siyuan <siyuan.fu@intel.com>2016-02-03 15:15:20 +0800
committerFu Siyuan <siyuan.fu@intel.com>2016-02-03 15:17:04 +0800
commitf000a8c60e8ea21704789c415a7279a5ed6ecd70 (patch)
tree9c80a13e26a26b82aca6c07a7f0dec1cf0bb72de /MdeModulePkg/Universal
parent072289f45c7ac13e6f70ba4ad739e95086e5d2d2 (diff)
downloadedk2-platforms-f000a8c60e8ea21704789c415a7279a5ed6ecd70.tar.xz
MdeModulePkg: Update DBsize in SNP GetStatus command.
Update the DBsize in GetStatus command to let UNDI return an array of recycled buffers. This is to make the loop at the end of PxeGetStatus() useful and to prevent buffer overflow with some non-conformant UNDI drivers which not check the value of the input DBsize in UNDI GetStatus command. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Sriram Subramanian <sriram-s@hpe.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
Diffstat (limited to 'MdeModulePkg/Universal')
-rw-r--r--MdeModulePkg/Universal/Network/SnpDxe/Get_status.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Get_status.c b/MdeModulePkg/Universal/Network/SnpDxe/Get_status.c
index 8f2ab9b24a..fad2e98212 100644
--- a/MdeModulePkg/Universal/Network/SnpDxe/Get_status.c
+++ b/MdeModulePkg/Universal/Network/SnpDxe/Get_status.c
@@ -65,11 +65,7 @@ PxeGetStatus (
Snp->Cdb.CPBsize = PXE_CPBSIZE_NOT_USED;
Snp->Cdb.CPBaddr = PXE_CPBADDR_NOT_USED;
- //
- // size DB for return of one buffer
- //
- Snp->Cdb.DBsize = (UINT16) ((sizeof (PXE_DB_GET_STATUS) - sizeof (Db->TxBuffer)) + sizeof (Db->TxBuffer[0]));
-
+ Snp->Cdb.DBsize = (UINT16) sizeof (PXE_DB_GET_STATUS);
Snp->Cdb.DBaddr = (UINT64)(UINTN) Db;
Snp->Cdb.StatCode = PXE_STATCODE_INITIALIZE;