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; } /**