Return-Path: Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 1CB597F76 for ; Tue, 18 Mar 2014 11:39:35 -0500 (CDT) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id F3A97304039 for ; Tue, 18 Mar 2014 09:39:34 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id ZFVBTx3fT2BUenP3 for ; Tue, 18 Mar 2014 09:39:31 -0700 (PDT) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s2IGdQ8T009647 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 18 Mar 2014 12:39:28 -0400 From: Eryu Guan Subject: [PATCH] xfs_quota: avoid segfault when report -h on non-existent path Date: Wed, 19 Mar 2014 00:39:06 +0800 Message-Id: <1395160746-26654-1-git-send-email-eguan@redhat.com> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com To: xfs@oss.sgi.com 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 Signed-off-by: Eryu Guan --- 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