If child_set env was called with a NULL env pointer and a non-zero count
it would end up in a null deref, although we don't currently do this.
Prompted by Coverity CID 291850, tweak & ok djm@
* If we're passed an uninitialized list, allocate a single null
* entry before continuing.
*/
+ if ((*envp == NULL) != (*envsizep == 0))
+ fatal_f("environment size mismatch");
if (*envp == NULL && *envsizep == 0) {
*envp = xmalloc(sizeof(char *));
*envp[0] = NULL;