[PATCH] stdlib: Perform NULL pointer check for the getenv argument
Sam James
sam@gentoo.org
Mon Jun 12 21:30:01 GMT 2023
Dennis Brendel via Libc-alpha <libc-alpha@sourceware.org> writes:
> 'name' is just de-referenced without checking for it being non-NULL.
> Passing NULL is not something one should do in the first place, but
> returning NULL seems to be reasonable in that case instead of just
> waiting for the segfault that might or might not be handled.
>
> This adds another barrier for e.g. safety applications.
>
See Carlos' email for why we can't do this, but I'm wondering what the
motivation here was and if we can do something to help with that?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 377 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20230612/90c6d198/attachment-0001.sig>
More information about the Libc-alpha
mailing list