This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Pointer to invalid multibyte sequence in mbsnrtowcs()
- From: Igor Liferenko <igor dot liferenko at gmail dot com>
- To: "Michael Kerrisk (man-pages)" <mtk dot manpages at gmail dot com>
- Cc: libc-help <libc-help at sourceware dot org>
- Date: Mon, 30 Jan 2017 09:53:02 +0700
- Subject: Re: Pointer to invalid multibyte sequence in mbsnrtowcs()
- Authentication-results: sourceware.org; auth=none
- References: <CAJyx363W9FDd-h2+uH1Rj+wOviCs9WX_d-PTFHnf9+Nb5Ag3DA@mail.gmail.com> <CAJyx362pgfPkm4hXppSzHs+S_W3uW67QUfJEOcvOwbJEBNzksg@mail.gmail.com> <c0af9296-8cf9-e5d7-6da2-627ac660a700@gmail.com>
The bug report is posted here:
https://sourceware.org/bugzilla/show_bug.cgi?id=21093
On 17/01/2017, Michael Kerrisk (man-pages) <mtk.manpages@gmail.com> wrote:
> On 12/20/2016 03:20 PM, Igor Liferenko wrote:
>> Hi Michael,
>>
>>> Output 1.2:
>>>
>>> status: 1
>>> Success
>>> ori=0x556497c29980
>>> new=0x556497c29983
>>
>> POSIX says:
>>
>> If the input buffer ends with an incomplete character, it is
>> unspecified whether conversion stops
>> at the end of the previous character (if any), or at the end of the
>> input buffer.
>>
>> As we see from the output of Example 1.2, glibc adopter the former
>> behavior.
>> But why *src was incremented by 3 to point past the end of the buffer
>> (from 0x556497c29980 to 0x556497c29983), not to the next multibyte
>> sequence to be converted (i.e., 0x556497c29982)?
>>
>> Is this POSIX behavior (and thus mbsnrtowcs(3) should be updated) or
>> it is a bug?
>
> Igor, I'm sorry, I just don't have the time to delve into this.
> If you can determine the answer to the question, let me know, and we can
> make a change to the man page.
>
> Thanks,
>
> Michael
> gg
>
>
> --
> Michael Kerrisk
> Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
> Linux/UNIX System Programming Training: http://man7.org/training/
>