mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-23 15:49:23 +00:00
fs/jfs: Do not move to leaf level if name length is negative
Fuzzing JFS revealed crashes where a negative number would be passed to le_to_cpu16_copy(). There it would be cast to a large positive number and the copy would read and write off the end of the respective buffers. Catch this at the top as well as the bottom of the loop. Signed-off-by: Daniel Axtens <dja@axtens.net> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
1 parent
8d3ae59dee
commit
ffd5a46f68
1 file changed
+1
-1
+1
-1
@@ -567,7 +567,7 @@ grub_jfs_getent (struct grub_jfs_diropen *diro)
|
||||
|
||||
/* Move down to the leaf level. */
|
||||
nextent = leaf->next;
|
||||
if (leaf->next != 255)
|
||||
if (leaf->next != 255 && len > 0)
|
||||
do
|
||||
{
|
||||
next_leaf = &diro->next_leaf[nextent];
|
||||
|
||||
Reference in new issue
Block a user