Page MenuHomeFreeBSD

libc/stdlib/getenv.c: always allocate new environment
Needs ReviewPublic

Authored by kib on Thu, Sep 24, 6:37 PM.
Tags
None
Referenced Files
F173554713: D59996.diff
Sat, Sep 26, 7:55 PM
F173550203: D59996.id187708.diff
Sat, Sep 26, 7:09 PM
F173538921: D59996.id187623.diff
Sat, Sep 26, 5:14 PM
F173506677: D59996.id187708.diff
Sat, Sep 26, 11:03 AM
Unknown Object (File)
Sat, Sep 26, 4:26 AM
Unknown Object (File)
Sat, Sep 26, 1:04 AM
Unknown Object (File)
Fri, Sep 25, 8:04 PM
Unknown Object (File)
Fri, Sep 25, 6:34 PM
Subscribers

Details

Reviewers
emaste
Group Reviewers
secteam
Summary
in particular, if the old environment is NULL.

Among making it less surprising for userspace to observe NULL environ,
the change also prevents NULL deref in __rebuild_environ() when
terminating the empty as NULL environment with the NULL pointer.

Reported by:     Leo Bicknell <bicknell@ufp.org>
PR:     298747

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

kib requested review of this revision.Thu, Sep 24, 6:37 PM
kib retitled this revision from libc/stdlib/getenv.c: do not deref NULL in __rebuild_environ() to libc/stdlib/getenv.c: always allocate new environment.
kib edited the summary of this revision. (Show Details)

Always allocate new environment instead of checking it for NULL.