This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][BZ #14134] Fix iconv segfault while converting fromIBM-930


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]