Module Name:    src
Committed By:   mrg
Date:           Mon Feb  4 04:37:50 UTC 2019

Modified Files:
        src/external/mpl/dhcp/dist/server: mdb6.c
        src/lib/libm/src: s_copysignl.c
        src/sys/compat/linux/common: linux_socket.c

Log Message:
- avoid uninitialised memory usage


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/mpl/dhcp/dist/server/mdb6.c
cvs rdiff -u -r1.5 -r1.6 src/lib/libm/src/s_copysignl.c
cvs rdiff -u -r1.143 -r1.144 src/sys/compat/linux/common/linux_socket.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mpl/dhcp/dist/server/mdb6.c
diff -u src/external/mpl/dhcp/dist/server/mdb6.c:1.3 src/external/mpl/dhcp/dist/server/mdb6.c:1.4
--- src/external/mpl/dhcp/dist/server/mdb6.c:1.3	Thu Jan 10 17:41:47 2019
+++ src/external/mpl/dhcp/dist/server/mdb6.c	Mon Feb  4 04:37:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: mdb6.c,v 1.3 2019/01/10 17:41:47 christos Exp $	*/
+/*	$NetBSD: mdb6.c,v 1.4 2019/02/04 04:37:50 mrg Exp $	*/
 
 /*
  * Copyright (C) 2007-2017 by Internet Systems Consortium, Inc. ("ISC")
@@ -17,7 +17,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: mdb6.c,v 1.3 2019/01/10 17:41:47 christos Exp $");
+__RCSID("$NetBSD: mdb6.c,v 1.4 2019/02/04 04:37:50 mrg Exp $");
 
 
 /*!
@@ -939,7 +939,7 @@ build_temporary6(struct in6_addr *addr, 
 		 const struct data_string *input) {
 	static u_int32_t history[2];
 	static u_int32_t counter = 0;
-	unsigned char md[16];
+	unsigned char md[16] = {0};
 	unsigned int len;
 
 	/*

Index: src/lib/libm/src/s_copysignl.c
diff -u src/lib/libm/src/s_copysignl.c:1.5 src/lib/libm/src/s_copysignl.c:1.6
--- src/lib/libm/src/s_copysignl.c:1.5	Thu May 14 19:26:12 2015
+++ src/lib/libm/src/s_copysignl.c	Mon Feb  4 04:37:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: s_copysignl.c,v 1.5 2015/05/14 19:26:12 joerg Exp $	*/
+/*	$NetBSD: s_copysignl.c,v 1.6 2019/02/04 04:37:50 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -26,11 +26,12 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: s_copysignl.c,v 1.5 2015/05/14 19:26:12 joerg Exp $");
+__RCSID("$NetBSD: s_copysignl.c,v 1.6 2019/02/04 04:37:50 mrg Exp $");
 #include "namespace.h"
 
 #include <math.h>
 #include <machine/ieee.h>
+#include <string.h>
 
 #if defined(__HAVE_LONG_DOUBLE) || defined(__HAVE_IBM_LONGDOUBLE)
 
@@ -61,6 +62,8 @@ copysignl(long double x, long double y)
 {
 	union ldbl_u ux, uy;
 
+	memset(&ux, 0, sizeof ux);
+	memset(&uy, 0, sizeof uy);
 	ux.ldblu_ld = x;
 	uy.ldblu_ld = y;
 	ux.ldblu_d[0] = copysign(ux.ldblu_d[0], uy.ldblu_d[0]);

Index: src/sys/compat/linux/common/linux_socket.c
diff -u src/sys/compat/linux/common/linux_socket.c:1.143 src/sys/compat/linux/common/linux_socket.c:1.144
--- src/sys/compat/linux/common/linux_socket.c:1.143	Wed Nov 14 17:51:37 2018
+++ src/sys/compat/linux/common/linux_socket.c	Mon Feb  4 04:37:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_socket.c,v 1.143 2018/11/14 17:51:37 hannken Exp $	*/
+/*	$NetBSD: linux_socket.c,v 1.144 2019/02/04 04:37:50 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.143 2018/11/14 17:51:37 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.144 2019/02/04 04:37:50 mrg Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -1829,7 +1829,7 @@ linux_sys_recvmmsg(struct lwp *l, const 
 	struct msghdr *msg = &bmsg.msg_hdr;
 	int error, s;
 	struct mbuf *from, *control;
-	struct timespec ts, now;
+	struct timespec ts = {0}, now;
 	struct linux_timespec lts;
 	unsigned int vlen, flags, dg;
 

Reply via email to