Srish Srinivasan fa93f2412b kern/command,commands/extcmd: Perform explicit NULL check in both the unregister helpers
During command registration, grub_register_command_prio() returns
a 0 when there is a failure in memory allocation. In such a situation,
calls to grub_unregister_{command(), extcmd()} during command
unregistration will result in dereferencing a NULL pointer.

Perform explicit NULL check in both unregister helpers to prevent
undefined behaviour due to a NULL pointer dereference.

Signed-off-by: Srish Srinivasan <ssrish@linux.ibm.com>
Reviewed-by: Sudhakar Kuppusamy <sudhakar@linux.ibm.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2025-10-11 15:36:54 +02:00
..
2022-03-14 15:46:55 +01:00
2020-07-29 16:55:47 +02:00
2023-05-25 16:48:00 +02:00
2025-01-23 16:22:47 +01:00
2012-02-26 22:49:24 +01:00
2010-05-06 11:34:04 +05:30