testing fs for NULL in expand_percent_expression():
e2fsck_ctx = fs ? (e2fsck_t) fs->priv_data : NULL;
implies that fs could be NULL, but it's passed to print_pathname()
which defererences it without further testing.
So make this safe by returning "???" for a nul fs.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
return;
}
- retval = ext2fs_get_pathname(fs, dir, ino, &path);
- if (retval)
+ if (fs)
+ retval = ext2fs_get_pathname(fs, dir, ino, &path);
+ if (!fs || retval)
fputs("???", stdout);
else {
safe_print(path, -1);