[patch] Error on setenv(..., NULL, ...)
Rich Felker
dalias@libc.org
Wed Mar 11 18:42:00 GMT 2015
On Wed, Mar 11, 2015 at 01:25:46PM -0400, Mike Frysinger wrote:
> On 11 Mar 2015 22:14, Siddhesh Poyarekar wrote:
> > On Wed, Mar 11, 2015 at 04:38:09PM +0000, Szabolcs Nagy wrote:
> > > no, this just says that NULL argument is undefined behaviour
> > >
> > > this is not a bug in glibc and i don't think any change should be made
> >
> > Fair enough, but if we ever decide to protect ourselves against such
> > bad access, I'd be in favour of something more conservative like
> > returning a blank string than returning an error.
>
> if we agree it's undefined behavior, then can't we have fortification turn this
> into a build failure ?
Not a build failure but a runtime trap. UB can't be caught at build
time because it's only forbidden if the statement that results in UB
is reached, and reachability is equivalent to the halting problem.
Rich
More information about the Libc-alpha
mailing list