NetBSD Problem Report #54326
From www@netbsd.org Mon Jun 24 14:16:54 2019
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 "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id CF0377A149
for <gnats-bugs@gnats.NetBSD.org>; Mon, 24 Jun 2019 14:16:53 +0000 (UTC)
Message-Id: <20190624141652.DB3987A1E9@mollari.NetBSD.org>
Date: Mon, 24 Jun 2019 14:16:52 +0000 (UTC)
From: dcb314@hotmail.com
Reply-To: dcb314@hotmail.com
To: gnats-bugs@NetBSD.org
Subject: src/sys/compat/sunos/sunos_misc.c: 1051: use of dangling pointer ?
X-Send-Pr-Version: www-1.0
>Number: 54326
>Category: kern
>Synopsis: src/sys/compat/sunos/sunos_misc.c: 1051: use of dangling pointer ?
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: kern-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Jun 24 14:20:01 +0000 2019
>Closed-Date: Wed Jul 03 18:25:58 +0000 2019
>Last-Modified: Wed Jul 03 18:25:58 +0000 2019
>Originator: David Binderman
>Release: cvs 20190624
>Organization:
>Environment:
>Description:
src/sys/compat/sunos/sunos_misc.c:1046] -> [src/sys/compat/sunos/sunos_misc.c:1039] -> [src/sys/compat/sunos/sunos_misc.c:1051]: (error) Using pointer to local variable 'bs' that is out of scope.
Source code is
if (sun_howto & SUNOS_RB_STRING) {
char bs[128];
error = copyinstr(SCARG(uap, bootstr), bs, sizeof(bs), 0);
if (error)
bootstr = NULL;
else
bootstr = bs;
} else
bootstr = NULL;
SCARG(&ua, opt) = bsd_howto;
SCARG(&ua, bootstr) = bootstr;
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
From: "David A. Holland" <dholland@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/54326 CVS commit: src/sys/compat/sunos
Date: Wed, 3 Jul 2019 18:24:50 +0000
Module Name: src
Committed By: dholland
Date: Wed Jul 3 18:24:50 UTC 2019
Modified Files:
src/sys/compat/sunos: sunos_misc.c
Log Message:
Stack buffers mustn't escape their scope. PR 54326 from David Binderman
To generate a diff of this commit:
cvs rdiff -u -r1.172 -r1.173 src/sys/compat/sunos/sunos_misc.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Wed, 03 Jul 2019 18:25:58 +0000
State-Changed-Why:
fixed, thanks
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.