Opened 20 months ago
Closed 20 months ago
#18350 closed bug (fixed)
mbrtoc32 returns wrong value for empty input
Reported by: | bhaible | Owned by: | nobody |
---|---|---|---|
Priority: | normal | Milestone: | R1/beta5 |
Component: | System/libroot.so | Version: | R1/beta4 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
When given an empty input, the mbrtoc32 function should return (size_t)(-2). This is clear from ISO C 23, section 7.30.1.5: "If s is not a null pointer, the mbrtoc32 function inspects at most n bytes beginning with the byte pointed to by s to determine the number of bytes needed to complete the next multibyte character (including any shift sequences)." If n is 0, the mbrtoc32 function cannot inspect anything, thus no complete multibyte character can be parsed in such a call.
How to reproduce:
$ gcc -Wall -ggdb foo.c $ ./a.out ret = 0 Abort
Attachments (1)
Change History (2)
by , 20 months ago
comment:1 by , 20 months ago
Milestone: | Unscheduled → R1/beta5 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Fixed in hrev56914.
Note:
See TracTickets
for help on using tickets.
test case