From 39941daf90572c818328de50fbcb7a5e5e0e7eb2 Mon Sep 17 00:00:00 2001 From: gikidy Date: Mon, 29 Jun 2009 03:42:33 +0000 Subject: Fix incorrect error handling when PXE boot timeout. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8675 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'MdeModulePkg/Universal') diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c index 646638674c..15444c1083 100644 --- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c +++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c @@ -2639,7 +2639,7 @@ EfiPxeLoadFile ( if (sizeof (UINTN) < sizeof (UINT64) && (TmpBufSize > 0xFFFFFFFF)) { Status = EFI_DEVICE_ERROR; - } else if (*BufferSize >= (UINTN) TmpBufSize && Buffer != NULL) { + } else if (TmpBufSize > 0 && *BufferSize >= (UINTN) TmpBufSize && Buffer != NULL) { *BufferSize = (UINTN) TmpBufSize; Status = PxeBc->Mtftp ( PxeBc, @@ -2653,7 +2653,7 @@ EfiPxeLoadFile ( NULL, FALSE ); - } else { + } else if (TmpBufSize > 0) { *BufferSize = (UINTN) TmpBufSize; Status = EFI_BUFFER_TOO_SMALL; } -- cgit v1.2.3