Module Name:    src
Committed By:   bouyer
Date:           Thu Feb  3 15:53:26 UTC 2011

Modified Files:
        src/usr.sbin/edquota [bouyer-quota2]: edquota.c

Log Message:
Avoid core dump when a filesystem is specified and not found in
mounted filesystems.


To generate a diff of this commit:
cvs rdiff -u -r1.29.16.6 -r1.29.16.7 src/usr.sbin/edquota/edquota.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/edquota/edquota.c
diff -u src/usr.sbin/edquota/edquota.c:1.29.16.6 src/usr.sbin/edquota/edquota.c:1.29.16.7
--- src/usr.sbin/edquota/edquota.c:1.29.16.6	Mon Jan 31 15:26:31 2011
+++ src/usr.sbin/edquota/edquota.c	Thu Feb  3 15:53:25 2011
@@ -1,4 +1,4 @@
-/*      $NetBSD: edquota.c,v 1.29.16.6 2011/01/31 15:26:31 bouyer Exp $ */
+/*      $NetBSD: edquota.c,v 1.29.16.7 2011/02/03 15:53:25 bouyer Exp $ */
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "from: @(#)edquota.c	8.3 (Berkeley) 4/27/95";
 #else
-__RCSID("$NetBSD: edquota.c,v 1.29.16.6 2011/01/31 15:26:31 bouyer Exp $");
+__RCSID("$NetBSD: edquota.c,v 1.29.16.7 2011/02/03 15:53:25 bouyer Exp $");
 #endif
 #endif /* not lint */
 
@@ -401,11 +401,13 @@
 		qup->next = 0;
 	}
 
-	if (filesys) {
+	if (filesys && quphead == NULL) {
 		if (defaultq)
 			errx(1, "no default quota for version 1");
 		/* if we get there, filesys is not mounted. try the old way */
 		qup = getprivs1(id, quotatype, filesys);
+		if (qup == NULL)
+			return NULL;
 		if (quphead == NULL)
 			quphead = qup;
 		else

Reply via email to