[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: test-memchr failure on rawhide
From: |
Jim Meyering |
Subject: |
Re: test-memchr failure on rawhide |
Date: |
Fri, 08 May 2009 12:45:00 +0200 |
Andreas Schwab wrote:
> Jim Meyering <address@hidden> writes:
>> cat > k.c <<\EOF
>> #include <string.h>
>> int main() { return !!(memchr (0, 'a', 0)); }
>> EOF
>> gcc -O k.c; ./a.out
>> Segmentation fault
>> [Exit 139 (SIGSEGV)]
>
> This is not a bug. NULL is not a valid object pointer.
It may not be a POSIX conformance issue when using NULL (if you're
convinced it is, please explain why), but even if that is, it's just a
technicality. When the specified length is 0, memchr must not dereference
the pointer. I could have used a pointer to an object that happens to
be unreadable.
- Re: test-memchr failure on rawhide, (continued)
- Re: test-memchr failure on rawhide, Andreas Schwab, 2009/05/11
- Re: test-memchr failure on rawhide, Ben Pfaff, 2009/05/09
- Re: test-memchr failure on rawhide, Bruno Haible, 2009/05/10
- Re: test-memchr failure on rawhide, Jim Meyering, 2009/05/11
- Re: test-memchr failure on rawhide, Bruno Haible, 2009/05/11
- Re: test-memchr failure on rawhide, Bruno Haible, 2009/05/12
- Re: test-memchr failure on rawhide, Eric Blake, 2009/05/12
- Re: test-memchr failure on rawhide, Jim Meyering, 2009/05/13
- Re: test-memchr failure on rawhide, Bruno Haible, 2009/05/13
- Re: test-memchr failure on rawhide, Eric Blake, 2009/05/13
Re: test-memchr failure on rawhide,
Jim Meyering <=