summaryrefslogtreecommitdiff
path: root/httpboot.c
diff options
context:
space:
mode:
Diffstat (limited to 'httpboot.c')
-rw-r--r--httpboot.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/httpboot.c b/httpboot.c
index dfa493bf..b34dd49c 100644
--- a/httpboot.c
+++ b/httpboot.c
@@ -578,7 +578,13 @@ receive_http_response(EFI_HTTP_PROTOCOL *http, VOID **buffer, UINT64 *buf_size)
}
if (*buf_size == 0) {
- perror(L"Failed to get Content-Lenght\n");
+ perror(L"Failed to get Content-Length\n");
+ goto error;
+ }
+
+ if (*buf_size < rx_message.BodyLength) {
+ efi_status = EFI_BAD_BUFFER_SIZE;
+ perror(L"Invalid Content-Length\n");
goto error;
}