NetBSD-Bugs archive

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

bin/38282: rtsol and rtsold -a don't work properly



>Number:         38282
>Category:       bin
>Synopsis:       rtsol and rtsold -a don't work properly
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 23 09:00:00 +0000 2008
>Originator:     Dave Huang
>Release:        NetBSD 4.99.55
>Organization:
Name: Dave Huang         |  Mammal, mammal / their names are called /
INet: khym%azeotrope.org@localhost |  they raise a paw / the bat, the cat /
FurryMUCK: Dahan         |  dolphin and dog / koala bear and hog -- TMBG
Dahan: Hani G Y+C 31 Y++ L+++ W- C++ T++ A+ E+ S++ V++ F- Q+++ P+ B+ PA+ PL++
>Environment:
        
        
System: NetBSD yerfable.azeotrope.org 4.99.55 NetBSD 4.99.55 (YERFABLE) #242: 
Mon Mar 17 07:52:38 CDT 2008 
khym%yerfable.azeotrope.org@localhost:/usr/obj.alpha/sys/arch/alpha/compile/YERFABLE
 alpha
Architecture: alpha
Machine: alpha
>Description:
        rtsol -a gives the error:
failed to get link layer information for 
failed to initialize 

And rtsold -a logs:
<ifconfig> failed to get link layer information for 
<main> failed to initialize 

They both work if an interface name is specified.

>How-To-Repeat:
        Run rtsol -a or rtsold -a.
>Fix:
        The routine to get the list of interfaces, autoifprobe(),
writes past the end of its buffer. The first time through the loop,
n == 0, and it allocates space for one string (i.e., argv[0]). However,
the n++ followed by argv[n] = NULL writes to argv[1], which hasn't
been allocated yet.

It seems that the block of code after the section that loops through
the interface list will make sure the array is terminated with a NULL
pointer; I don't think it's necessary to do so in the loop itself.

Index: rtsold.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/rtsold/rtsold.c,v
retrieving revision 1.33
diff -u -r1.33 rtsold.c
--- rtsold.c    7 Oct 2006 17:27:57 -0000       1.33
+++ rtsold.c    23 Mar 2008 06:47:51 -0000
@@ -762,7 +762,6 @@
                if (!argv[n])
                        err(1, "strdup");
                n++;
-               argv[n] = NULL;
        }
 
        if (n) {

>Unformatted:
        
        


Home | Main Index | Thread Index | Old Index