diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2017-09-10 23:07:54 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2017-09-10 23:07:54 +0200 |
commit | e3e7590cbb15e675fbada1c0d012ffe43776e221 (patch) | |
tree | f2a7a2bb0b5409afa4f248af60b8d1b31b811578 /exec | |
parent | 7d906d22cf1953641303966a756f3c44535001ae (diff) | |
download | hurd-e3e7590cbb15e675fbada1c0d012ffe43776e221.tar.gz hurd-e3e7590cbb15e675fbada1c0d012ffe43776e221.tar.bz2 hurd-e3e7590cbb15e675fbada1c0d012ffe43776e221.zip |
exec: Avoid calling mmap with zero size
mmap is supposed to return an error on passing a zero size.
* exec/exec.c (servercopy): Immediately return NULL if argsize is 0.
Diffstat (limited to 'exec')
-rw-r--r-- | exec/exec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/exec/exec.c b/exec/exec.c index f5995ac5..d78c54c5 100644 --- a/exec/exec.c +++ b/exec/exec.c @@ -773,6 +773,8 @@ servercopy (void *arg, mach_msg_type_number_t argsize, boolean_t argcopy, { if (! argcopy) return arg; + if (! argsize) + return NULL; /* ARG came in-line, so we must copy it. */ void *copy; |