Subject: port-i386/547: mount_nfs crashes with no arguments
To: None <>
From: Robert Dobbs <>
List: netbsd-bugs
Date: 11/03/1994 01:05:03
>Number:         547
>Category:       port-i386
>Synopsis:       run mount_nfs on an i386 machine; core dump
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov  3 01:05:02 1994
>Originator:     Robert Dobbs
>Release:        1.0B supped 10/31/94
386/25,387,8meg,ESDI, std compile
System: NetBSD 1.0 NetBSD 1.0 (GABRIELLA) #3: Tue Nov 1 18:14:30 PST 1994 i386

	Run mount_nfs with no arguments and it core dumps.
	gabriella% mount_nfs
	Segmentation fault (core dumped)

Program received signal SIGSEGV (11), Segmentation fault
0xba58 in strncpy ()
(gdb) where
#0  0xba58 in strncpy ()
#1  0x1e64 in getnfsargs (spec=0x0, nfsargsp=0xf7bfdc6c)
    at /usr/src/sbin/mount_nfs/mount_nfs.c:378
#2  0x1ca2 in main (argc=0, argv=0xf7bfdcd4)
    at /usr/src/sbin/mount_nfs/mount_nfs.c:299

Need to detect that there are no arguments and call usage() before
calling getnfsargs().