Index | Thread | Search

From:
"Lyndon Nerenberg (VE7TFX/VE6BBM)" <lyndon@orthanc.ca>
Subject:
Re: setenv(3) segfaults when value == NULL
To:
"Theo de Raadt" <deraadt@openbsd.org>
Cc:
enh <enh@google.com>, tech@openbsd.org
Date:
Fri, 13 Mar 2026 17:44:42 -0700

Download raw body.

Thread
  • Theo de Raadt:

    setenv(3) segfaults when value == NULL

    • Lyndon Nerenberg (VE7TFX/VE6BBM):

      setenv(3) segfaults when value == NULL

  • Theo de Raadt writes:
    
    > Furthermore I disagree with this trend to "always return an error
    > vaue".
    >
    > An example is fclose(NULL).
    >
    > That crashes.  It *SHOULD* crash, so that you can find and fix the bug.
    
    Well then you better change setenv() so it segfaults if name == NULL,
    too. Or *name = '\0'.  It's a simple fix, just remove that if
    statement.  Don't forget to update the man page.
    
    --lyndon
    
    
  • Theo de Raadt:

    setenv(3) segfaults when value == NULL