Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Apr 2012 03:33:05 -0400
From:      David Schultz <das@FreeBSD.org>
To:        Peter Jeremy <peterjeremy@acm.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
Message-ID:  <20120421073305.GA18432@zim.MIT.EDU>
In-Reply-To: <20120421070554.GA59737@server.vk2pj.dyndns.org>
References:  <201204210608.q3L682O3074354@svn.freebsd.org> <20120421070554.GA59737@server.vk2pj.dyndns.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Apr 21, 2012, Peter Jeremy wrote:
> On 2012-Apr-21 06:08:02 +0000, David Schultz <das@FreeBSD.org> 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120421073305.GA18432>