Qu Wenruo
2013-Nov-27 05:33 UTC
[PATCH v4] btrfs-progs: Fix a segfault when using btrfs-corrupt-block with "-U"
When using "-U" option with btrfs-corrupt-block, it will cause a segfault due to a missing break in getopt switch. Reported-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> --- btrfs-corrupt-block.c | 1 + 1 file changed, 1 insertion(+) diff --git a/btrfs-corrupt-block.c b/btrfs-corrupt-block.c index f0c14a9..a2828d4 100644 --- a/btrfs-corrupt-block.c +++ b/btrfs-corrupt-block.c @@ -758,6 +758,7 @@ int main(int ac, char **av) break; case ''U'': chunk_tree = 1; + break; case ''i'': inode = atoll(optarg); if (inode == 0) { -- 1.8.4.2 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Qu Wenruo
2013-Nov-27 05:38 UTC
Re: [PATCH v4] btrfs-progs: Fix a segfault when using btrfs-corrupt-block with "-U"
Sorry for the wrong patch version. It is just a normal bug fix, V4 is wrong and not necessary. Qu On Wed, 27 Nov 2013 13:33:28 +0800, Qu Wenruo wrote:> When using "-U" option with btrfs-corrupt-block, it will cause a > segfault due to a missing break in getopt switch. > > Reported-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> > Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> > --- > btrfs-corrupt-block.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/btrfs-corrupt-block.c b/btrfs-corrupt-block.c > index f0c14a9..a2828d4 100644 > --- a/btrfs-corrupt-block.c > +++ b/btrfs-corrupt-block.c > @@ -758,6 +758,7 @@ int main(int ac, char **av) > break; > case ''U'': > chunk_tree = 1; > + break; > case ''i'': > inode = atoll(optarg); > if (inode == 0) {-- ----------------------------------------------------- Qu Wenruo Development Dept.I Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST) No. 6 Wenzhu Road, Nanjing, 210012, China TEL: +86+25-86630566-8526 COINS: 7998-8526 FAX: +86+25-83317685 MAIL: quwenruo@cn.fujitsu.com ----------------------------------------------------- -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html