From owner-cvs-all Thu Mar 7 3:50:49 2002 Delivered-To: cvs-all@freebsd.org Received: from storm.FreeBSD.org.uk (storm.FreeBSD.org.uk [194.242.139.170]) by hub.freebsd.org (Postfix) with ESMTP id 7ECE137B41A; Thu, 7 Mar 2002 03:50:43 -0800 (PST) Received: (from uucp@localhost) by storm.FreeBSD.org.uk (8.11.6/8.11.6) with UUCP id g27BogY52064; Thu, 7 Mar 2002 11:50:42 GMT (envelope-from mark@grimreaper.grondar.za) Received: from grimreaper (localhost [127.0.0.1]) by grimreaper.grondar.org (8.12.2/8.12.2) with ESMTP id g27BktRV009651; Thu, 7 Mar 2002 11:46:55 GMT (envelope-from mark@grimreaper.grondar.za) Message-Id: <200203071146.g27BktRV009651@grimreaper.grondar.org> To: Mike Barcroft Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.bin/rwall rwall.c References: <20020307060920.C81803@espresso.q9media.com> In-Reply-To: <20020307060920.C81803@espresso.q9media.com> ; from Mike Barcroft "Thu, 07 Mar 2002 06:09:20 EST." Date: Thu, 07 Mar 2002 11:46:55 +0000 From: Mark Murray Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > > - if ((fd = mkstemp(tmpname)) == -1 || !(fp = fdopen(fd, "r+"))) > > + fd = mkstemp(tmpname); > > + fp = fdopen(fd, "r+"); > > + if (fd == -1 || !fp) > > > > Why did you need to do such code restructuring? > > This introduces a bug where fdopen() could attempt to open a bad file > descriptor in the case of an error with mkstemp(). I'll fix that. M -- o Mark Murray \_ O.\_ Warning: this .sig is umop ap!sdn To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message