btrfsck open_ctree sanity check
PATCH 1/1 btrfsck open_ctree sanity check
i.e Permission denied, open_ctree will return NULL, then lead to a segment fault later.
Signed-off-by Yongli He <[email protected]>
--- btrfsck.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
btrfsck.c +5 -0
@@ -770,6 +770,11 @@ int main(int ac, char **av) {cache_tree_init (&reada); root =open_ctree (av[1 ],0 ,0 ); +if (!root){ +perror ("open" ); +exit (1 ); + } + bits_nr =1024 ; bits =malloc (bits_nr *sizeof (struct block_info ));
Signature · 1 line
1.5.4.3