commit-hurd
[Top][All Lists]
Advanced

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

[hurd] 41/43: exec: Avoid calling mmap with zero size


From: Samuel Thibault
Subject: [hurd] 41/43: exec: Avoid calling mmap with zero size
Date: Mon, 11 Sep 2017 07:10:12 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch upstream
in repository hurd.

commit e3e7590cbb15e675fbada1c0d012ffe43776e221
Author: Samuel Thibault <address@hidden>
Date:   Sun Sep 10 23:07:54 2017 +0200

    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.
---
 exec/exec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/exec/exec.c b/exec/exec.c
index f5995ac..d78c54c 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;

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/hurd.git



reply via email to

[Prev in Thread] Current Thread [Next in Thread]