NetBSD Problem Report #54325

From www@netbsd.org  Mon Jun 24 14:14:23 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 DAB5E7A149
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 24 Jun 2019 14:14:22 +0000 (UTC)
Message-Id: <20190624141422.0B8A57A1A1@mollari.NetBSD.org>
Date: Mon, 24 Jun 2019 14:14:22 +0000 (UTC)
From: dcb314@hotmail.com
Reply-To: dcb314@hotmail.com
To: gnats-bugs@NetBSD.org
Subject: src/sys/arch/atari/atari/machdep.c: 289: use of dangling pointer ?  
X-Send-Pr-Version: www-1.0

>Number:         54325
>Category:       port-atari
>Synopsis:       src/sys/arch/atari/atari/machdep.c: 289: use of dangling pointer ?
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    tsutsui
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 24 14:15:00 +0000 2019
>Closed-Date:    Sat Jun 29 03:23:50 +0000 2019
>Last-Modified:  Sat Jun 29 03:23:50 +0000 2019
>Originator:     David Binderman
>Release:        cvs 20190624
>Organization:
>Environment:
>Description:
src/sys/arch/atari/atari/machdep.c:273] -> [src/sys/arch/atari/atari/machdep.c:267] -> [src/sys/arch/atari/atari/machdep.c:289]: (error) Using pointer to local variable 'cputxt' that is out of scope.

      const char *mach, *mmu, *fpu, *cpu;

...
               {
                        uint32_t        pcr;
                        char            cputxt[30];

                        __asm(".word 0x4e7a,0x0808;"
                            "movl %%d0,%0" : "=d"(pcr) : : "d0");
                        snprintf(cputxt, sizeof(cputxt), "68%s060 rev.%d",
                            pcr & 0x10000 ? "LC/EC" : "", (pcr >> 8) & 0xff);
                        cpu = cputxt;

...

   cpu_setmodel("%s (%s CPU%s%sFPU)", mach, cpu, mmu, fpu);

>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:
From: "Izumi Tsutsui" <tsutsui@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/54325 CVS commit: src/sys/arch/atari/atari
Date: Sat, 29 Jun 2019 03:19:49 +0000

 Module Name:	src
 Committed By:	tsutsui
 Date:		Sat Jun 29 03:19:49 UTC 2019

 Modified Files:
 	src/sys/arch/atari/atari: machdep.c

 Log Message:
 Fix PR/54325 (use of dangling pointer).


 To generate a diff of this commit:
 cvs rdiff -u -r1.178 -r1.179 src/sys/arch/atari/atari/machdep.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

Responsible-Changed-From-To: kern-bug-people->tsutsui
Responsible-Changed-By: tsutsui@NetBSD.org
Responsible-Changed-When: Sat, 29 Jun 2019 03:23:50 +0000
Responsible-Changed-Why:


State-Changed-From-To: open->closed
State-Changed-By: tsutsui@NetBSD.org
State-Changed-When: Sat, 29 Jun 2019 03:23:50 +0000
State-Changed-Why:
Fixed.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(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.