NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/56673: don't allow execve with NULL argv



Am Sun, Jan 30, 2022 at 01:40:01PM +0000 schrieb Robert Elz:
> The following reply was made to PR kern/56673; it has been noted by GNATS.
> 
> From: Robert Elz <kre%munnari.OZ.AU@localhost>
> To: gnats-bugs%netbsd.org@localhost
> Cc: 
> Subject: Re: kern/56673: don't allow execve with NULL argv
> Date: Sun, 30 Jan 2022 20:37:47 +0700
> 
>      Date:        Sun, 30 Jan 2022 13:05:01 +0000 (UTC)
>      From:        Christos Zoulas <christos%zoulas.com@localhost>
>      Message-ID:  <20220130130501.C1D9D1A923D%mollari.NetBSD.org@localhost>
>  
>    |  Enough programs assume it is there and dereference it without checking.
>  
>  It was this kind of reasoning that led to making  *NULL == '\0'
>  
>  Long term it is better to just fix progs making faulty assumptions
>  than to try to cater to all of those.

IMO POSIX at least implies that argc > 0:

  The argument arg0 should point to a filename string that is associated
  with the process being started by one of the exec functions.

I really don't see a point in allow argc==0 to be valid.

Joerg


Home | Main Index | Thread Index | Old Index