commit-hurd
[Top][All Lists]
Advanced

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

[hurd] 65/75: pflocal: Do not abort on too small getopt parameter


From: Samuel Thibault
Subject: [hurd] 65/75: pflocal: Do not abort on too small getopt parameter
Date: Thu, 14 Jan 2016 01:04:11 +0000

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

sthibault pushed a commit to branch dde
in repository hurd.

commit 4f9cbfeaf4421ccb0dd0867664f6d689794ef9f3
Author: Samuel Thibault <address@hidden>
Date:   Sun Jan 3 04:42:04 2016 +0100

    pflocal: Do not abort on too small getopt parameter
    
    * pflocal/socket.c (S_socket_getopt): When *value_len is too small, return
    EINVAL instead of aborting.
---
 pflocal/socket.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/pflocal/socket.c b/pflocal/socket.c
index b1f9d77..f2b75a7 100644
--- a/pflocal/socket.c
+++ b/pflocal/socket.c
@@ -441,7 +441,11 @@ S_socket_getopt (struct sock_user *user,
       switch (opt)
        {
        case SO_TYPE:
-         assert (*value_len >= sizeof (int));
+         if (*value_len < sizeof (int))
+           {
+             ret = EINVAL;
+             break;
+           }
          *(int *)*value = user->sock->pipe_class->sock_type;
          *value_len = sizeof (int);
          break;

-- 
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]