mbstowcs (pwcs=0x0, s=0x0, n=0) segfaults
Ulrich Drepper
drepper@redhat.com
Wed Jun 28 16:37:00 GMT 2000
Andreas Jaeger <aj@suse.de> writes:
> playing around with the other tests I noticed that mbstowcs produces a
> segmentation fault with all 0 arguments:
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x8054082 in __mbsrtowcs (dst=0x0, src=0xbffff658, len=0, ps=0xbffff644)
> at mbsrtowcs.c:70
> 70 const unsigned char *srcend = inbuf + strlen (inbuf) + 1;
> (gdb) bt
The standard does not say anything about *src == NULL being a valid
input. Therefore is the implementation correct.
More information about the Libc-hacker
mailing list