]> git.ipfire.org Git - thirdparty/grub.git/commit
commands/menuentry: Fix for out of bound access
authorSudhakar Kuppusamy <sudhakar@linux.ibm.com>
Thu, 9 Oct 2025 09:19:39 +0000 (14:49 +0530)
committerDaniel Kiper <daniel.kiper@oracle.com>
Sat, 11 Oct 2025 13:43:59 +0000 (15:43 +0200)
commit6b5c671d35b1b84468da1fef2b9bd8e05682f7e6
tree88e05f2bf1630b8a12ca85f523650840cc43a8df
parent21cdcb125c84840dba2aa14e696da90495e24732
commands/menuentry: Fix for out of bound access

A menu entry with an empty title leads to an out-of-bounds access at
"ch = src[len - 1]", i.e., "src" is empty and "len" is zero. So, fixing
this by checking the menu entry title length and throwing an error if
the length is zero.

Signed-off-by: Sridhar Markonda <sridharm@linux.ibm.com>
Signed-off-by: Sudhakar Kuppusamy <sudhakar@linux.ibm.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/commands/menuentry.c