NetBSD Problem Report #51803

From www@NetBSD.org  Tue Jan 10 00:32:05 2017
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 BA5717A289
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 10 Jan 2017 00:32:05 +0000 (UTC)
Message-Id: <20170110003204.D02307A2A2@mollari.NetBSD.org>
Date: Tue, 10 Jan 2017 00:32:04 +0000 (UTC)
From: yaneurabeya@gmail.com
Reply-To: yaneurabeya@gmail.com
To: gnats-bugs@NetBSD.org
Subject: lib/libc/ttyio/t_ttyio:tty coverity fix
X-Send-Pr-Version: www-1.0

>Number:         51803
>Category:       bin
>Synopsis:       lib/libc/ttyio/t_ttyio:tty coverity fix
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 10 00:35:00 +0000 2017
>Closed-Date:    Tue Jan 10 05:11:42 +0000 2017
>Last-Modified:  Tue Jan 10 05:11:42 +0000 2017
>Originator:     Ngie Cooper
>Release:        n/a
>Organization:
>Environment:
n/a
>Description:
tty: don't leak s after opening it with openpty

Reported by:    Coverity
CID:            978321
>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:
From: "Ngie Cooper (yaneurabeya)" <yaneurabeya@gmail.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/51803: lib/libc/ttyio/t_ttyio:tty coverity fix
Date: Mon, 9 Jan 2017 16:56:22 -0800

 --Apple-Mail=_67FB1AF5-DD3C-4929-A473-CCA740AB584B
 Content-Transfer-Encoding: 7bit
 Content-Type: text/plain;
 	charset=us-ascii

 Patch attached.


 --Apple-Mail=_67FB1AF5-DD3C-4929-A473-CCA740AB584B
 Content-Disposition: attachment;
 	filename=lib-libc-ttyio-t_ttyio-cleanup-socket-when-done.patch
 Content-Type: application/octet-stream;
 	x-unix-mode=0644;
 	name="lib-libc-ttyio-t_ttyio-cleanup-socket-when-done.patch"
 Content-Transfer-Encoding: 7bit

 Index: tests/lib/libc/ttyio/t_ttyio.c
 ===================================================================
 RCS file: /cvsroot/src/tests/lib/libc/ttyio/t_ttyio.c,v
 retrieving revision 1.2
 diff -u -r1.2 t_ttyio.c
 --- tests/lib/libc/ttyio/t_ttyio.c	19 Apr 2011 20:07:53 -0000	1.2
 +++ tests/lib/libc/ttyio/t_ttyio.c	9 Jan 2017 23:49:09 -0000
 @@ -152,6 +152,7 @@
  	REQUIRE_ERRNO(sigaction(SIGCHLD, &sa, NULL), -1);
  	(void) wait(NULL);

 +	(void)close(s);
  	ATF_REQUIRE_EQ(rc, 0);
  }


 --Apple-Mail=_67FB1AF5-DD3C-4929-A473-CCA740AB584B--

From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/51803 CVS commit: src/tests/lib/libc/ttyio
Date: Mon, 9 Jan 2017 20:31:40 -0500

 Module Name:	src
 Committed By:	christos
 Date:		Tue Jan 10 01:31:40 UTC 2017

 Modified Files:
 	src/tests/lib/libc/ttyio: t_ttyio.c

 Log Message:
 PR/51803: Ngie Cooper: CID 978321: Don't leak openpty() fd.


 To generate a diff of this commit:
 cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/ttyio/t_ttyio.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: Tue, 10 Jan 2017 05:11:42 +0000
State-Changed-Why:
christos committed it, thanks :-)


>Unformatted:

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.