Source-Changes-HG archive

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

[src/trunk]: src/sbin/mount Fix core dump when doing



details:   https://anonhg.NetBSD.org/src/rev/72ce8afbabe0
branches:  trunk
changeset: 579567:72ce8afbabe0
user:      lukem <lukem%NetBSD.org@localhost>
date:      Fri Mar 18 04:24:35 2005 +0000

description:
Fix core dump when doing
        mount fileserver:/somepath
by not passing a NULL pointer to getfsfile(3).
(Bug was introduced in rev 1.74 as part of fix for PR 28644.)

diffstat:

 sbin/mount/mount.c |  13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diffs (43 lines):

diff -r ff77a89355aa -r 72ce8afbabe0 sbin/mount/mount.c
--- a/sbin/mount/mount.c        Fri Mar 18 00:12:35 2005 +0000
+++ b/sbin/mount/mount.c        Fri Mar 18 04:24:35 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mount.c,v 1.76 2005/02/05 14:44:46 xtraeme Exp $       */
+/*     $NetBSD: mount.c,v 1.77 2005/03/18 04:24:35 lukem Exp $ */
 
 /*
  * Copyright (c) 1980, 1989, 1993, 1994
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)mount.c    8.25 (Berkeley) 5/8/95";
 #else
-__RCSID("$NetBSD: mount.c,v 1.76 2005/02/05 14:44:46 xtraeme Exp $");
+__RCSID("$NetBSD: mount.c,v 1.77 2005/03/18 04:24:35 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -211,7 +211,7 @@
 
                if (init_flags & MNT_UPDATE) {
                        /*
-                        * Try lookin up the canonical path first,
+                        * Try looking up the canonical path first,
                         * then try exactly what the user entered.
                         */
                        if ((canonical_path == NULL ||
@@ -235,11 +235,12 @@
                        mountopts  = NULL;
                } else {
                        /*
-                        * Try lookin up the canonical path first,
+                        * Try looking up the canonical path first,
                         * then try exactly what the user entered.
                         */
-                       if ((fs = getfsfile(canonical_path)) == NULL &&
-                           (fs = getfsspec(canonical_path)) == NULL)
+                       if (canonical_path == NULL ||
+                           ((fs = getfsfile(canonical_path)) == NULL &&
+                            (fs = getfsspec(canonical_path)) == NULL))
                        {
                                if ((fs = getfsfile(*argv)) == NULL &&
                                    (fs = getfsspec(*argv)) == NULL)



Home | Main Index | Thread Index | Old Index