Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern pass valsize for getsockopt like we do for setsockopt
details: https://anonhg.NetBSD.org/src/rev/36a95f488320
branches: trunk
changeset: 358471:36a95f488320
user: christos <christos%NetBSD.org@localhost>
date: Sun Dec 31 19:39:57 2017 +0000
description:
pass valsize for getsockopt like we do for setsockopt
diffstat:
sys/kern/uipc_syscalls.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diffs (30 lines):
diff -r b1d73d5e4697 -r 36a95f488320 sys/kern/uipc_syscalls.c
--- a/sys/kern/uipc_syscalls.c Sun Dec 31 15:41:05 2017 +0000
+++ b/sys/kern/uipc_syscalls.c Sun Dec 31 19:39:57 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uipc_syscalls.c,v 1.188 2017/12/26 08:30:58 kamil Exp $ */
+/* $NetBSD: uipc_syscalls.c,v 1.189 2017/12/31 19:39:57 christos Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.188 2017/12/26 08:30:58 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.189 2017/12/31 19:39:57 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_pipe.h"
@@ -1235,7 +1235,10 @@
if ((error = fd_getsock1(SCARG(uap, s), &so, &fp)) != 0)
return (error);
- sockopt_init(&sopt, SCARG(uap, level), SCARG(uap, name), 0);
+ if (valsize > MCLBYTES)
+ return EINVAL;
+
+ sockopt_init(&sopt, SCARG(uap, level), SCARG(uap, name), valsize);
if (fp->f_flag & FNOSIGPIPE)
so->so_options |= SO_NOSIGPIPE;
Home |
Main Index |
Thread Index |
Old Index