Bug 1471

Summary: mbrtowc does not set output wchar when converting null char
Product: uClibc Reporter: Michael Deutschmann <michael>
Component: LocalesAssignee: unassigned
Status: RESOLVED FIXED    
Severity: minor CC: uclibc-cvs
Priority: P5    
Version: 0.9.30.3   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: i386-pc-linux-uclibc Target: i386-pc-linux-uclibc
Build: i386-pc-linux-uclibc
Attachments: Test for broken mbrtowc

Description Michael Deutschmann 2010-04-01 03:29:00 UTC
Created attachment 1441 [details]
Test for broken mbrtowc

The standards require mbrtowc to store an output value in the provided wchar_t pointer in all non-error conditions.  But uClibc does not do this when converting the terminating zero of a string, instead leaving whatever garbage was previously there alone.

This causes GNU tar 1.23 to assertion-fail in some cases.

A simple demonstration is attached.
Comment 1 Bernhard Reutner-Fischer 2010-11-24 19:59:34 UTC
Fixed in 86b4bf7d3194a06281f053be341031d9196874c2
Thanks for the report!