util.c (get_backup_sb): Check to make sure the context is passed

in non-NULL before trying to dereference it.  Otherwise we
	might core dump when called to expand %S in a problem
	description.
bitmap-optimize
Theodore Ts'o 2003-08-24 21:36:38 -04:00
parent a7ac1df34f
commit 557ddb2fdf
2 changed files with 10 additions and 2 deletions

View File

@ -1,5 +1,10 @@
2003-08-24 Theodore Ts'o <tytso@mit.edu>
* util.c (get_backup_sb): Check to make sure the context is passed
in non-NULL before trying to dereference it. Otherwise we
might core dump when called to expand %S in a problem
description.
* e2fsck.8.in: Adjust description line so that apropos
"ext2" or "ext3" will find the man page. (Addresses
Debian Bug #206845)

View File

@ -439,8 +439,11 @@ blk_t get_backup_sb(e2fsck_t ctx, ext2_filsys fs, const char *name,
ext2fs_swap_super(sb);
#endif
if (sb->s_magic == EXT2_SUPER_MAGIC) {
ret_sb = ctx->superblock = superblock;
ctx->blocksize = blocksize;
ret_sb = superblock;
if (ctx) {
ctx->superblock = superblock;
ctx->blocksize = blocksize;
}
break;
}
}