From owner-svn-src-all@FreeBSD.ORG Tue Apr 24 03:56:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CF2A01065748; Tue, 24 Apr 2012 03:56:46 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 23D808FC0C; Tue, 24 Apr 2012 03:56:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3O3ujog029183; Tue, 24 Apr 2012 03:56:45 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3O3uj3j029181; Tue, 24 Apr 2012 03:56:45 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201204240356.q3O3uj3j029181@svn.freebsd.org> From: David Schultz Date: Tue, 24 Apr 2012 03:56:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234632 - stable/9/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2012 03:56:47 -0000 Author: das Date: Tue Apr 24 03:56:45 2012 New Revision: 234632 URL: http://svn.freebsd.org/changeset/base/234632 Log: MFC r234528, r234536: Fix an infinite loop in fputws(). Modified: stable/9/lib/libc/stdio/fputws.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/stdio/fputws.c ============================================================================== --- stable/9/lib/libc/stdio/fputws.c Tue Apr 24 03:56:39 2012 (r234631) +++ stable/9/lib/libc/stdio/fputws.c Tue Apr 24 03:56:45 2012 (r234632) @@ -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);