From owner-freebsd-standards Sun Jan 5 17: 0:11 2003 Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DBE3937B401 for ; Sun, 5 Jan 2003 17:00:09 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9873F43EE5 for ; Sun, 5 Jan 2003 17:00:07 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h06107NS039656 for ; Sun, 5 Jan 2003 17:00:07 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h06107ru039655; Sun, 5 Jan 2003 17:00:07 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2D51637B408 for ; Sun, 5 Jan 2003 16:56:25 -0800 (PST) Received: from smtp04.iprimus.com.au (smtp04.iprimus.com.au [210.50.76.52]) by mx1.FreeBSD.org (Postfix) with ESMTP id A30F543EA9 for ; Sun, 5 Jan 2003 16:56:24 -0800 (PST) (envelope-from tim@robbins.dropbear.id.au) Received: from smtp02.iprimus.net.au (210.50.76.70) by smtp04.iprimus.com.au (6.7.010) id 3DF583C3002757E9 for FreeBSD-gnats-submit@freebsd.org; Mon, 6 Jan 2003 11:56:17 +1100 Received: from dilbert.robbins.dropbear.id.au ([210.50.248.91]) by smtp02.iprimus.net.au with Microsoft SMTPSVC(5.0.2195.5600); Mon, 6 Jan 2003 11:56:16 +1100 Received: from dilbert.robbins.dropbear.id.au (1hk9glo9k4lxh6np@localhost [127.0.0.1]) by dilbert.robbins.dropbear.id.au (8.12.6/8.12.6) with ESMTP id h060u8JX018070 for ; Mon, 6 Jan 2003 11:56:09 +1100 (EST) (envelope-from tim@dilbert.robbins.dropbear.id.au) Received: (from tim@localhost) by dilbert.robbins.dropbear.id.au (8.12.6/8.12.6/Submit) id h060u8BY018069; Mon, 6 Jan 2003 11:56:08 +1100 (EST) (envelope-from tim) Message-Id: <200301060056.h060u8BY018069@dilbert.robbins.dropbear.id.au> Date: Mon, 6 Jan 2003 11:56:08 +1100 (EST) From: Tim Robbins Reply-To: Tim Robbins To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: standards/46791: freopen() does not handle filename == NULL correctly Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG >Number: 46791 >Category: standards >Synopsis: freopen() does not handle filename == NULL correctly >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-standards >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Jan 05 17:00:07 PST 2003 >Closed-Date: >Last-Modified: >Originator: Tim Robbins >Release: FreeBSD 4.7-RELEASE-p2 i386 >Organization: FreeBSD >Environment: N/A >Description: ISO/IEC 9899:1999 ("C99") section 7.19.5.4 contains the following text: 3 If filename is a null pointer, the freopen function attempts to change the mode of the stream to that specified by mode, as if the name of the file currently associated with the stream had been used. It is implementation-defined which changes of mode are permitted (if any), and under what circumstances. (end quote) It could be sufficient to just check that the mode is the same as the one passed to fopen() and to do nothing if it is or to close the file and return NULL otherwise. >How-To-Repeat: freopen(NULL, "r", stdin); passes NULL to open(2), causing freopen() to return NULL with errno = EFAULT. >Fix: Not provided. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Fri Jan 10 11:47:30 2003 Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A774837B401; Fri, 10 Jan 2003 11:47:29 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4DCB443E4A; Fri, 10 Jan 2003 11:47:29 -0800 (PST) (envelope-from gerald@FreeBSD.org) Received: from freefall.freebsd.org (gerald@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h0AJlTNS094389; Fri, 10 Jan 2003 11:47:29 -0800 (PST) (envelope-from gerald@freefall.freebsd.org) Received: (from gerald@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h0AJlSIG094385; Fri, 10 Jan 2003 11:47:28 -0800 (PST) Date: Fri, 10 Jan 2003 11:47:28 -0800 (PST) From: Gerald Pfeifer Message-Id: <200301101947.h0AJlSIG094385@freefall.freebsd.org> To: pfeifer@dbai.tuwien.ac.at, gerald@FreeBSD.org, freebsd-standards@FreeBSD.org Subject: Re: standards/40402: /usr/include/stddef.h and /usr/include/stdlib.h cause compiler warnings Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Synopsis: /usr/include/stddef.h and /usr/include/stdlib.h cause compiler warnings State-Changed-From-To: open->closed State-Changed-By: gerald State-Changed-When: Fri Jan 10 11:46:04 PST 2003 State-Changed-Why: A fix has been MFCed Fri, 13 Dec 2002. See http://www.freebsd.org/cgi/query-pr.cgi?pr=43780 for details. http://www.freebsd.org/cgi/query-pr.cgi?pr=40402 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message