From: Robbie Harwood Date: Tue, 25 Apr 2023 15:05:14 +0000 (-0400) Subject: net/http: check result of grub_netbuff_put() in http_receive() X-Git-Tag: archive/raspbian/2.12-8+rpi1^2~115 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=edd3d517c0225b125dbf1c594228b32b43d007e8;p=grub2.git net/http: check result of grub_netbuff_put() in http_receive() Co-authored-by: Peter Jones Signed-off-by: Peter Jones Signed-off-by: Robbie Harwood Gbp-Pq: Topic network Gbp-Pq: Name net-http-check-result-of-grub_netbuff_put-in-http_receive.patch --- diff --git a/grub-core/net/http.c b/grub-core/net/http.c index f389bf0..69b6296 100644 --- a/grub-core/net/http.c +++ b/grub-core/net/http.c @@ -291,7 +291,9 @@ http_receive (grub_net_tcp_socket_t sock __attribute__ ((unused)), nb2 = grub_netbuff_alloc (data->chunk_rem); if (!nb2) return grub_errno; - grub_netbuff_put (nb2, data->chunk_rem); + err = grub_netbuff_put (nb2, data->chunk_rem); + if (err) + return grub_errno; grub_memcpy (nb2->data, nb->data, data->chunk_rem); if (file->device->net->packs.count >= 20) {