From: Darrick J. Wong Date: Fri, 9 Mar 2018 02:35:23 +0000 (-0600) Subject: xfs_db: don't crash in ablock if there's no inode X-Git-Tag: v4.16.0-rc1~48 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=de24d640d5e30bbaf25ac314f95cbcbec9a97966;p=thirdparty%2Fxfsprogs-dev.git xfs_db: don't crash in ablock if there's no inode Make sure we actually have an inode selected before trying to unwrap its attribute fork. Found via a crash in xfs/288 with project quotas enabled. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen Signed-off-by: Eric Sandeen --- diff --git a/db/block.c b/db/block.c index 5ecd687ad..174e29ad4 100644 --- a/db/block.c +++ b/db/block.c @@ -84,6 +84,11 @@ ablock_f( } push_cur(); set_cur_inode(iocur_top->ino); + if (!iocur_top->data) { + pop_cur(); + dbprintf(_("no current inode\n")); + return 0; + } haveattr = XFS_DFORK_Q((xfs_dinode_t *)iocur_top->data); pop_cur(); if (!haveattr) {