bin/167039: fputws(3) generates infinite output

Peter Jeremy peterjeremy at acm.org
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
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 17 21:10:02 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Peter Jeremy
>Release:        FreeBSD 8.2-STABLE amd64
>Organization:
n/a
>Environment:
System: FreeBSD server.vk2pj.dyndns.org 8.2-STABLE FreeBSD 8.2-STABLE #15: Thu Feb 2 11:02:29 EST 2012 root at server.vk2pj.dyndns.org:/var/obj/usr/src/sys/server amd64

>Description:
	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.

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

int main(void)
{
    fputws(L"abc", stdout);
    putchar('\n');
    return(0);
}

>Fix:
	Not clear at present.


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list