From owner-svn-src-head@FreeBSD.ORG Sat Apr 21 07:53:43 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A063D1065673; Sat, 21 Apr 2012 07:53:43 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 62FB78FC08; Sat, 21 Apr 2012 07:53:43 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q3L7X5F1026994; Sat, 21 Apr 2012 03:33:05 -0400 (EDT) (envelope-from das@FreeBSD.org) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q3L7X5Q5026993; Sat, 21 Apr 2012 03:33:05 -0400 (EDT) (envelope-from das@FreeBSD.org) Date: Sat, 21 Apr 2012 03:33:05 -0400 From: David Schultz To: Peter Jeremy Message-ID: <20120421073305.GA18432@zim.MIT.EDU> Mail-Followup-To: Peter Jeremy , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201204210608.q3L682O3074354@svn.freebsd.org> <20120421070554.GA59737@server.vk2pj.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120421070554.GA59737@server.vk2pj.dyndns.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r234528 - head/lib/libc/stdio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2012 07:53:43 -0000 On Sat, Apr 21, 2012, Peter Jeremy wrote: > On 2012-Apr-21 06:08:02 +0000, David Schultz wrote: > >Log: > > Fix a bug introduced in r187302 that was causing fputws() to enter an > > infinite loop pretty much unconditionally. > > Unfortunately, I suspect you've just turned an unconditional infinite > loop into a conditional one. There's still a "wsp = ws;" inside the > loop so if you pass in a long string (one that exceeds BUFSIZ bytes > when converted to a multi-byte string) then wsp will be non-NULL > after the call to __wcsnrtombs(), causing the do loop to loop and > then wsp will be re-initialised to ws. I think the fix is to move > the "wsp = ws;" outside the loop. Whoops -- good catch. This should be fixed now.