[PATCH 09/11] xfsprogs: xfs_repair: fix possible null dereference in traverse_int_dir2block

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fix possible null dereference in traverse_int_dir2block if buffer pointer is NULL.
Reported by coverity.

Signed-off-by: Vivek Trivedi <t.vivek@xxxxxxxxxxx>
---
 repair/dir2.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/repair/dir2.c b/repair/dir2.c
index 61912d1..fe360dc 100644
--- a/repair/dir2.c
+++ b/repair/dir2.c
@@ -1300,7 +1300,7 @@ _("block %" PRIu64 " for directory inode %" PRIu64 " is missing\n"),
 		bp = da_read_buf(mp, nex, bmp, &xfs_dir3_data_buf_ops);
 		if (bmp != &lbmp)
 			free(bmp);
-		if (bp == NULL) {
+		if (bp == NULL || !bp->b_addr) {
 			do_warn(
 _("can't read block %" PRIu64 " for directory inode %" PRIu64 "\n"),
 				dbno, ino);
-- 
1.7.9.5

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs



[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux