[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug#192537: sort segfaults with argv[0] = NULL
From: |
Paul Eggert |
Subject: |
Re: Bug#192537: sort segfaults with argv[0] = NULL |
Date: |
10 May 2003 23:51:46 -0700 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 |
Jim Meyering <address@hidden> writes:
> You're probably already aware that very many programs assume that
> `argc' is always 1 or larger, and hence dereference argv[0]
> unconditionally.
POSIX requires that any Strictly Conforming POSIX Application must
pass at least one argument to the exec function family, thus
guaranteeing that argv[0] can be dereferenced unconditionally in the
exec'ed program. See the RATIONALE section of
<http://www.opengroup.org/onlinepubs/007904975/functions/exec.html>.
I suppose it's a bit nicer if programs work even when argv[0] is NULL,
but this would require hacking a lot of code, and it sounds a bit like
makework to me. So, like Jim, I'm curious as to the motivation for
this bug report.