summaryrefslogtreecommitdiff
path: root/pflocal
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2016-01-03 04:42:04 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2016-01-03 04:42:04 +0100
commit4f9cbfeaf4421ccb0dd0867664f6d689794ef9f3 (patch)
treea9d0769f16b9fc5f3c577ca458d4135afe970359 /pflocal
parent046b776f2eb0f5b2fb26f86e987fc8185f8a6444 (diff)
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.
Diffstat (limited to 'pflocal')
-rw-r--r--pflocal/socket.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/pflocal/socket.c b/pflocal/socket.c
index b1f9d770..f2b75a70 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;