From owner-svn-src-all@FreeBSD.ORG Sat Apr 21 06:08:03 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 03D46106566B; Sat, 21 Apr 2012 06:08:03 +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 E3DEF8FC0A; Sat, 21 Apr 2012 06:08:02 +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 q3L682ks074356; Sat, 21 Apr 2012 06:08:02 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3L682O3074354; Sat, 21 Apr 2012 06:08:02 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201204210608.q3L682O3074354@svn.freebsd.org> From: David Schultz Date: Sat, 21 Apr 2012 06:08:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234528 - head/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: Sat, 21 Apr 2012 06:08:03 -0000 Author: das Date: Sat Apr 21 06:08:02 2012 New Revision: 234528 URL: http://svn.freebsd.org/changeset/base/234528 Log: Fix a bug introduced in r187302 that was causing fputws() to enter an infinite loop pretty much unconditionally. It's remarkable that the patch that introduced the bug was never tested, but even more remarkable that nobody noticed for over two years. PR: 167039 MFC after: 3 days Modified: head/lib/libc/stdio/fputws.c Modified: head/lib/libc/stdio/fputws.c ============================================================================== --- head/lib/libc/stdio/fputws.c Sat Apr 21 05:26:02 2012 (r234527) +++ head/lib/libc/stdio/fputws.c Sat Apr 21 06:08:02 2012 (r234528) @@ -70,7 +70,7 @@ fputws_l(const wchar_t * __restrict ws, iov.iov_len = uio.uio_resid = nbytes; if (__sfvwrite(fp, &uio) != 0) goto error; - } while (ws != NULL); + } while (wsp != NULL); FUNLOCKFILE(fp); return (0);