[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: BUG REPORT: glibc 2.2 mbrtowc() fails to decode final byte
From: |
Ulrich Drepper |
Subject: |
Re: BUG REPORT: glibc 2.2 mbrtowc() fails to decode final byte |
Date: |
10 Jan 2001 13:53:33 -0800 |
User-agent: |
Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Capitol Reef) |
Markus Kuhn <address@hidden> writes:
> The following regression test fails in glibc 2.2 under linux-i386:
As Andreas said, this code doesn't fail anymore. But furthermore it's
incorrect:
> assert(mbrtowc(NULL, NULL, 0, &s) == 0); /* get s into initial state */
This is not how initializing a mbstate_t object can work. Since the
mbrtowc() function can read the mbstate_t object it will read
uninitialized memory. One has to use memset().
--
---------------. ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Red Hat `--' drepper at redhat.com `------------------------