Whamcloud - gitweb
ext2fs: fix off-by-one in dx_grow_tree()
authorJan Kara <jack@suse.cz>
Mon, 30 Mar 2020 09:09:32 +0000 (11:09 +0200)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 10 Apr 2020 04:10:53 +0000 (00:10 -0400)
commitaf7293fe8a6d7b9af70f90b1ccdc91a0e2fec7f8
tree7995529e347640a480e02f28f82fc81921beca62
parentcceebf4ece9fe75fac685f49c090211be390f083
ext2fs: fix off-by-one in dx_grow_tree()

There is an off-by-one error in dx_grow_tree() when checking whether we
can add another level to the tree. Thus we can grow tree too much
leading to possible crashes in the library or corrupted filesystem. Fix
the bug.

Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/link.c