linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfs_quota: avoid segfault when report -h on non-existent path
@ 2014-03-18 16:39 Eryu Guan
  2014-03-18 17:06 ` Eric Sandeen
  0 siblings, 1 reply; 3+ messages in thread
From: Eryu Guan @ 2014-03-18 16:39 UTC (permalink / raw)
  To: xfs; +Cc: Eryu Guan, Eric Sandeen

Command xfs_quota -xc "report -h" /nosuchdir would get segfault, fix
that by checking fs_path first before dereferencing it.

Cc: Eric Sandeen <esandeen@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
---
 quota/report.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/quota/report.c b/quota/report.c
index 70894a2..d486524 100644
--- a/quota/report.c
+++ b/quota/report.c
@@ -624,7 +624,7 @@ report_f(
 		if (flags & ALL_MOUNTS_FLAG)
 			report_any_type(fp, form, type, NULL,
 					lower, upper, flags);
-		else if (fs_path->fs_flags & FS_MOUNT_POINT)
+		else if (fs_path && fs_path->fs_flags & FS_MOUNT_POINT)
 			report_any_type(fp, form, type, fs_path->fs_dir,
 					lower, upper, flags);
 	} else while (argc > optind) {
-- 
1.8.5.3

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-03-19  1:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-18 16:39 [PATCH] xfs_quota: avoid segfault when report -h on non-existent path Eryu Guan
2014-03-18 17:06 ` Eric Sandeen
2014-03-19  1:47   ` Jeff Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).