NetBSD Problem Report #51259
From www@NetBSD.org Mon Jun 20 13:41:11 2016
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id 4FA877A467
for <gnats-bugs@gnats.NetBSD.org>; Mon, 20 Jun 2016 13:41:11 +0000 (UTC)
Message-Id: <20160620134110.71EC87AAA1@mollari.NetBSD.org>
Date: Mon, 20 Jun 2016 13:41:10 +0000 (UTC)
From: dcb314@hotmail.com
Reply-To: dcb314@hotmail.com
To: gnats-bugs@NetBSD.org
Subject: src/sys/net/if_mpls.c:464: possible bad return ?
X-Send-Pr-Version: www-1.0
>Number: 51259
>Category: kern
>Synopsis: src/sys/net/if_mpls.c:464: possible bad return ?
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: kern-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Jun 20 13:45:00 +0000 2016
>Closed-Date: Wed Jun 22 08:38:34 +0000 2016
>Last-Modified: Wed Jun 22 08:50:00 +0000 2016
>Originator: David Binderman
>Release: cvs dated 20160620
>Organization:
>Environment:
>Description:
src/sys/net/if_mpls.c:464]: (style) Variable 'ret' is not assigned a value.
Source code is
#ifdef INET
ret = ip_if_output(ifp, m, rt->rt_gateway, rt);
#else
if_output_lock(ifp, ifp, m, rt->rt_gateway, rt);
#endif
return ret;
and
int ret;
So there are some paths through the code where uninitialised
rubbish off the stack is the return value.
Suggest avoid. Maybe init ret to some sensible value
at its declaration might be a good idea.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->Closed
State-Changed-By: knakahara@NetBSD.org
State-Changed-When: Wed, 22 Jun 2016 08:38:34 +0000
State-Changed-Why:
State-Changed-From-To: Closed->closed
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Wed, 22 Jun 2016 08:40:39 +0000
State-Changed-Why:
case fix
From: Kengo NAKAHARA <k-nakahara@iij.ad.jp>
To: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org, netbsd-bugs@netbsd.org,
gnats-admin@netbsd.org, wiz@NetBSD.org, dcb314@hotmail.com
Cc:
Subject: Re: kern/51259 (src/sys/net/if_mpls.c:464: possible bad return ?)
Date: Wed, 22 Jun 2016 17:48:58 +0900
fixed by if_mpls.c:r1.25
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.