diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2019-05-16 00:27:43 +0300 |
---|---|---|
committer | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2019-05-19 09:10:10 +0300 |
commit | ce54fdc492dfac6c52fcd369a7414d5ef1f3ded9 (patch) | |
tree | 60016ccb604b9f5a2a6a43594d8adb041bf1c4f8 | |
parent | 487d8c75f1d3a1cf084e7fd61955591edc083f80 (diff) | |
download | u-boot-ce54fdc492dfac6c52fcd369a7414d5ef1f3ded9.tar.xz |
efi_loader: parameter checks simple network protocol
Check buffer pointers are not NULL as required by the UEFI 2.7 spec.
Return EFI_UNSUPPORTED instead of EFI_INVALID_PARAMETER when trying to
transmit with non-zero header_size.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
-rw-r--r-- | lib/efi_loader/efi_net.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/efi_loader/efi_net.c b/lib/efi_loader/efi_net.c index e0e222a70b..d71c663068 100644 --- a/lib/efi_loader/efi_net.c +++ b/lib/efi_loader/efi_net.c @@ -392,7 +392,7 @@ static efi_status_t EFIAPI efi_net_transmit efi_timer_check(); /* Check parameters */ - if (!this) { + if (!this || !buffer) { ret = EFI_INVALID_PARAMETER; goto out; } @@ -408,7 +408,7 @@ static efi_status_t EFIAPI efi_net_transmit * TODO: We would need to create the header * if header_size != 0 */ - ret = EFI_INVALID_PARAMETER; + ret = EFI_UNSUPPORTED; goto out; } @@ -466,7 +466,7 @@ static efi_status_t EFIAPI efi_net_receive efi_timer_check(); /* Check parameters */ - if (!this) { + if (!this || !buffer || !buffer_size) { ret = EFI_INVALID_PARAMETER; goto out; } |