plan9fox/sys
cinap_lenrek 2acb02f29b kernel: reject empty argv (argv[0] == nil) in sysexec()
when executing a script, we did advance argp0 unconditionally
to replace argv[0] with the script name. this fails when
argv[] is empty, then we'd advance argp0 past the nil terminator.

the alternative would be to *not* advance if *argp0 == nil, but that
would require another validaddr() check for a case that is unlikely
to have been anticipated in most programs being invoked as
libc's ARGBEGIN macro assumes argv[0] being non-nil as it also
unconditionally advances the argv pointer.

to keep us sane, we now reject an empty argv[]. on entry, we
verify that argv[] is valid for at least two elements:
- the program name argv[0], has to be non-nil
- the first potential nil terminator in argv[1]

when argv[0] == nil, we throw Ebadarg "bad arg in system call"
2015-08-06 08:47:38 +02:00
..
doc
games/lib fortunes: go away. 2015-07-22 21:35:50 -04:00
include ape: implement altzone for tzset() 2015-08-04 02:01:41 +02:00
lib authsrv: remove unused opasstokey 2015-06-09 23:53:07 +02:00
man libc: make atoi() not parse c-style octal and hex numbers 2015-08-03 18:10:53 +02:00
src kernel: reject empty argv (argv[0] == nil) in sysexec() 2015-08-06 08:47:38 +02:00