Date: Tue, 24 Apr 2012 03:56:40 +0000 (UTC) From: David Schultz <das@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r234631 - stable/8/lib/libc/stdio Message-ID: <201204240356.q3O3ueci029142@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: das Date: Tue Apr 24 03:56:39 2012 New Revision: 234631 URL: http://svn.freebsd.org/changeset/base/234631 Log: MFC r234528, r234536: Fix an infinite loop in fputws(). Modified: stable/8/lib/libc/stdio/fputws.c Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/stdio/fputws.c ============================================================================== --- stable/8/lib/libc/stdio/fputws.c Tue Apr 24 03:30:26 2012 (r234630) +++ stable/8/lib/libc/stdio/fputws.c Tue Apr 24 03:56:39 2012 (r234631) @@ -54,8 +54,8 @@ fputws(const wchar_t * __restrict ws, FI uio.uio_iov = &iov; uio.uio_iovcnt = 1; iov.iov_base = buf; + wsp = ws; do { - wsp = ws; nbytes = __wcsnrtombs(buf, &wsp, SIZE_T_MAX, sizeof(buf), &fp->_mbstate); if (nbytes == (size_t)-1) @@ -63,7 +63,7 @@ fputws(const wchar_t * __restrict ws, FI iov.iov_len = uio.uio_resid = nbytes; if (__sfvwrite(fp, &uio) != 0) goto error; - } while (ws != NULL); + } while (wsp != NULL); FUNLOCKFILE(fp); return (0);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201204240356.q3O3ueci029142>