Subject: kern/1646: if_ppp.c references uninitialized auto variable
To: None <gnats-bugs@gnats.netbsd.org>
From: enami tsugutomo <enami@sys.ptg.sony.co.jp>
List: netbsd-bugs
Date: 10/18/1995 21:14:47
>Number:         1646
>Category:       kern
>Synopsis:       if_ppp.c references uninitialized auto variable.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 18 08:35:03 1995
>Last-Modified:
>Originator:     enami tsugutomo
>Organization:
	Sony Corporation.
>Release:        NetBSD-current Oct 08 or around
>Environment:
System: NetBSD king-show 1.0A NetBSD 1.0A (KINGSHOW) #0: Mon Oct 2 22:49:42 JST 1995 root@king-show:/usr/src/sys/arch/i386/compile/KINGSHOW i386

>Description:
	In the following piece of code, the auto variable `ilen' is used
	but not initialized.

static void
ppp_inproc(sc, m)
    struct ppp_softc *sc;
    struct mbuf *m;
{
    struct ifqueue *inq;
    int s, ilen, xlen, proto, rv;

		:

    if (sc->sc_flags & SC_LOG_INPKT) {
	printf("ppp%d: got %d bytes\n", sc->sc_if.if_unit, ilen);
	pppdumpm(m);
    }
>How-To-Repeat:
	Run pppd with kdebug 31 or so, the it reports in the /var/log/messages
		ppp0: got 0 bytes or ppp0: got -126324864 bytes
	and so on.
>Fix:
	Use it after initalized or never use it.
>Audit-Trail:
>Unformatted: