Whamcloud - gitweb
e2fsck: make sure get_backup_sb() works when ctx is NULL
authorTheodore Ts'o <tytso@mit.edu>
Wed, 24 Apr 2024 01:37:03 +0000 (21:37 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 24 Apr 2024 01:37:03 +0000 (21:37 -0400)
commita12302fa683e397a731e679bd1b818c45ad3ff78
tree406b118b1679cf5f386dc3f4a05466de2320ea6b
parent49125d40ff36490af218f46b9b4d1fdf96553dcd
e2fsck: make sure get_backup_sb() works when ctx is NULL

The print_e2fsck_message() function can call get_backup_sb() with the
ctx variable set to NULL.  In that case, we can't dereference
ctx->filesystem_name; instead, we can get the size of the file system
from the ext2fs_block_count(fs->super).

Addresses-Coverity-Bug: 1596517
Addresses-Coverity-Bug: 1596505
Fixes: b53ce7848c2e ("e2fsck: don't try backup superblocks beyond...")
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/util.c