[PATCH][BZ #14134] Fix iconv segfault while converting from IBM-930
Siddhesh Poyarekar
siddhesh@redhat.com
Mon Jun 4 17:57:00 GMT 2012
On Mon, 4 Jun 2012 19:21:17 +0200, Petr wrote:
> Shouldn't this be a problem for rp1 (single-byte) table as well?
>
> Also, this just doesn't make sense to me. The termination entry is
> there precisely to break searching the array in the first place, and
> it should work due to the initial test
>
> if (__builtin_expect (ch >= 0xffff, 0)) \
> { \
> UNICODE_TAG_HANDLER (ch, 4); \
> STANDARD_TO_LOOP_ERR_HANDLER (4); \
> }
>
> How can control pass this test if ch == 0xffff?
>
I think you're looking at it the other way around. The crash is for
conversion from ibm930 to utf, which does not have this test. The
above test is there in utf to ibm930. Ditto for single-byte case, since
a single-byte case would be announced by an 0x0f.
To be honest this is the first time I've seen the iconvdata code, but
that's what I get based on my code reading.
--
Siddhesh
More information about the Libc-alpha
mailing list