summaryrefslogtreecommitdiff
path: root/Nt32Pkg/SnpNt32Dxe
diff options
context:
space:
mode:
authorhhuan13 <hhuan13@6f19259b-4bc3-4df7-8a09-765794883524>2010-12-08 04:42:40 +0000
committerhhuan13 <hhuan13@6f19259b-4bc3-4df7-8a09-765794883524>2010-12-08 04:42:40 +0000
commitaaf779a7ec7890520d57fd5bb4cc40c826dd42e5 (patch)
tree0ad86b83f06dcc743238e4d79d0db38fe3b31b73 /Nt32Pkg/SnpNt32Dxe
parentfe295078f26cc08652e167783722fad6bb089d81 (diff)
downloadedk2-platforms-aaf779a7ec7890520d57fd5bb4cc40c826dd42e5.tar.xz
Fixed a bug: when underlayer receives much more data, return EFI_BUFFER_TOO_SMALL.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11132 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Nt32Pkg/SnpNt32Dxe')
-rw-r--r--Nt32Pkg/SnpNt32Dxe/SnpNt32.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Nt32Pkg/SnpNt32Dxe/SnpNt32.c b/Nt32Pkg/SnpNt32Dxe/SnpNt32.c
index 46bc8768f0..86414696c4 100644
--- a/Nt32Pkg/SnpNt32Dxe/SnpNt32.c
+++ b/Nt32Pkg/SnpNt32Dxe/SnpNt32.c
@@ -995,6 +995,9 @@ SnpNt32Receive (
SNPNT32_INSTANCE_DATA *Instance;
SNPNT32_GLOBAL_DATA *GlobalData;
INT32 ReturnValue;
+ UINTN BufSize;
+
+ BufSize = *BuffSize;
Instance = SNP_NT32_INSTANCE_DATA_FROM_SNP_THIS (This);
@@ -1042,7 +1045,7 @@ SnpNt32Receive (
*Protocol = NTOHS (*((UINT16 *) (((UINT8 *) Buffer) + 12)));
}
- return EFI_SUCCESS;
+ return (*BuffSize <= BufSize) ? EFI_SUCCESS : EFI_BUFFER_TOO_SMALL;
}
/**