NetBSD Problem Report #4

From jtc  Thu Oct  7 10:46:03 1993
Received: from localhost (jtc@localhost) by sun-lamp.cs.berkeley.edu (8.3/8.3) id KAA11465; Thu, 7 Oct 1993 10:46:03 -0700
Message-Id: <199310071746.KAA11465@sun-lamp.cs.berkeley.edu>
Date: Thu, 7 Oct 1993 10:46:03 -0700
From: "J.T. Conklin" <jtc>
To: gnats-bugs@sun-lamp.cs.berkeley.edu

>Number:         4
>Category:       lib
>Synopsis:       Perror() shouldn't change strerrors() static buffer.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    jtc
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 07 10:50:04 +0000 1993
>Closed-Date:    Thu Oct 07 12:29:20 +0000 1993
>Last-Modified:  Mon Aug 11 06:46:31 +0000 2014
>Originator:     
>Release:        0.9
>Organization:
Winning Strategies, Inc.
>Environment:
System: NetBSD sun-lamp.cs.berkeley.edu 0.9a SUN_LAMP#6 i386

>Description:
	Perror is not allowed to change the contents of the strerror()'s
	static buffer (the buffer is used when there is no error message 
	string corresponding to a particular error number), so it cannot
	call strerror().

>How-To-Repeat:
	char *p;

	p = strerror(1000);
	printf ("%s\n", p);

	errno = 2000;
	perror(NULL);

	printf ("%s\n", p);
>Fix:
>Release-Note:
>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: jtc
State-Changed-When: Thu Oct  7 12:29:20 1993
State-Changed-Why:
I have changed the strerror() and perror() functions to pass their own buffers
to the new library-internal function _strerror() that actually does the error
message string look up.

>Unformatted:
 To: gnats-bugs@sun-lamp.cs.berkeley.edu
 Subject: perror modifies strerror()'s static buffer
 From: jtc@sun-lamp.cs.berkeley.edu
 Reply-To: jtc@sun-lamp.cs.berkeley.edu
 X-send-pr-version: 3.01

NetBSD Home
NetBSD PR Database Search

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