bin/167039: fputws(3) generates infinite output

Peter Jeremy peterjeremy at
Tue Apr 17 21:10:03 UTC 2012

>Number:         167039
>Category:       bin
>Synopsis:       fputws(3) generates infinite output
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 17 21:10:02 UTC 2012
>Originator:     Peter Jeremy
>Release:        FreeBSD 8.2-STABLE amd64
System: FreeBSD 8.2-STABLE FreeBSD 8.2-STABLE #15: Thu Feb 2 11:02:29 EST 2012 root at amd64

	Programs using fputws(3) generate an apparently infinite
	number of copies of the string passed to fputws().

	The code in src/lib/libc/stdio/fputws.c has no obvious mechanism
	for loop termination except in the case of an error.  This
	appears to be a regression introduced in r187302.

	The following sample code generates an infinite series of "abc":
#include <stdio.h>
#include <wchar.h>

int main(void)
    fputws(L"abc", stdout);

	Not clear at present.


More information about the freebsd-bugs mailing list