Skip to contentSkip to conversation

ieee1275/ofnet: Fix grub_malloc() removed after added safe math functions

PATCH In review Nicolas Frayer via Grub-devel 2 participants 2 messages Mar 19, 2025 – Mar 20, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ieee1275/ofnet: Fix grub_malloc() removed after added safe math functions

grub_malloc() has been inadvertently removed from the ieee1275/ofnet code after it has been modified to use safe match function.

Fixes 4beeff8a (net: Use safe math macros to prevent overflows)
---
 grub-core/net/drivers/ieee1275/ofnet.c | 3 +++
 1 file changed, 3 insertions(+)
grub-core/net/drivers/ieee1275/ofnet.c +3 -0
index 3e1b9094e2ab..37bc82467f60 100644
@@ -463,6 +463,9 @@ search_net_devices (struct grub_ieee1275_devalias *alias)
 	  return 0;
 	}
     }
+
+  ofdata->path = grub_malloc(sz);
+
   if (!ofdata->path)
     {
       grub_print_error ();
Signature · 7 lines
2.46.1


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Nicolas Frayer via Grub-devel

grub_malloc() has been inadvertently removed from the ieee1275/ofnet code after it has been modified to use safe match function.

Fixes 4beeff8a (net: Use safe math macros to prevent overflows)

I have missed that during review. Sorry...

Daniel

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel