grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v5 03/20] net/http: check result of grub_netbuff_put() in http_re


From: Robbie Harwood
Subject: [PATCH v5 03/20] net/http: check result of grub_netbuff_put() in http_receive()
Date: Tue, 25 Apr 2023 11:05:14 -0400

Co-authored-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
---
 grub-core/net/http.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/grub-core/net/http.c b/grub-core/net/http.c
index df690acf67..406777b01b 100644
--- a/grub-core/net/http.c
+++ b/grub-core/net/http.c
@@ -295,7 +295,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)
            {
-- 
2.40.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]