net/http: check result of grub_netbuff_put() in http_receive()
authorRobbie Harwood <rharwood@redhat.com>
Tue, 25 Apr 2023 15:05:14 +0000 (11:05 -0400)
committerFelix Zielcke <fzielcke@z-51.de>
Wed, 11 Jun 2025 15:42:34 +0000 (17:42 +0200)
Co-authored-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
Gbp-Pq: Topic network
Gbp-Pq: Name net-http-check-result-of-grub_netbuff_put-in-http_receive.patch

grub-core/net/http.c

index f389bf03d96282a212bb9904d310328a6ca13650..69b62969597cc2432d48fcb1c328e3cd144d8d60 100644 (file)
@@ -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)
            {