fs/sfs: Check if allocated memory is NULL
authorAlec Brown <alec.r.brown@oracle.com>
Tue, 28 Jan 2025 05:15:50 +0000 (05:15 +0000)
committerFelix Zielcke <fzielcke@z-51.de>
Wed, 11 Jun 2025 15:42:34 +0000 (17:42 +0200)
commit1a5745ec98d46fa0363b551e12d60950622f800e
tree717ad0af87c80d1697bf3d39b99ae04258dc3341
parent93cc584dce5fba9c488ba1008d27168cc73559e5
fs/sfs: Check if allocated memory is NULL

When using grub_zalloc(), if we are out of memory, this function can fail.
After allocating memory, we should check if grub_zalloc() returns NULL.
If so, we should handle this error.

Fixes: CID 473856
Signed-off-by: Alec Brown <alec.r.brown@oracle.com>
Reviewed-by: Ross Philipson <ross.philipson@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Gbp-Pq: Topic cve-2025-jan
Gbp-Pq: Name fs-sfs-Check-if-allocated-memory-is-NULL.patch
grub-core/fs/sfs.c