seekdir dereferences null

Eric Blake
Sat Dec 6 16:30:00 GMT 2008

Hash: SHA1

According to Schwarz, Konrad on 12/5/2008 1:36 AM:
>> the bug is in the RTEMS test 
>> suite for not 
>> passing a valid DIR* in the first place, and not in newlib 
>> for crashing on 
>> invalid input
> I fully support this position. I checked the POSIX document 
> yesterday, and it indeed does not say anything about a NULL DIR*,
> but was ultimately too lazy to write out against this.

Actually, POSIX _is_ explicit about null pointer checks:

"Each of the following statements shall apply unless explicitly stated
otherwise in the detailed descriptions that follow:

   "1. If an argument to a function has an invalid value (such as a value
outside the domain of the function, or a pointer outside the address space
of the program, or a null pointer), the behavior is undefined."

- --
Don't work too hard, make some time for fun as well!

Eric Blake   
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at
Comment: Using GnuPG with Mozilla -


More information about the Newlib mailing list