Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src - avoid uninitialised memory usage
details: https://anonhg.NetBSD.org/src/rev/d1a0ea7dbc2e
branches: trunk
changeset: 448494:d1a0ea7dbc2e
user: mrg <mrg%NetBSD.org@localhost>
date: Mon Feb 04 04:37:50 2019 +0000
description:
- avoid uninitialised memory usage
diffstat:
external/mpl/dhcp/dist/server/mdb6.c | 6 +++---
lib/libm/src/s_copysignl.c | 7 +++++--
sys/compat/linux/common/linux_socket.c | 6 +++---
3 files changed, 11 insertions(+), 8 deletions(-)
diffs (86 lines):
diff -r c336d89f55d6 -r d1a0ea7dbc2e external/mpl/dhcp/dist/server/mdb6.c
--- a/external/mpl/dhcp/dist/server/mdb6.c Mon Feb 04 04:36:41 2019 +0000
+++ b/external/mpl/dhcp/dist/server/mdb6.c Mon Feb 04 04:37:50 2019 +0000
@@ -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 @@
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;
/*
diff -r c336d89f55d6 -r d1a0ea7dbc2e lib/libm/src/s_copysignl.c
--- a/lib/libm/src/s_copysignl.c Mon Feb 04 04:36:41 2019 +0000
+++ b/lib/libm/src/s_copysignl.c Mon Feb 04 04:37:50 2019 +0000
@@ -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 @@
{
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]);
diff -r c336d89f55d6 -r d1a0ea7dbc2e sys/compat/linux/common/linux_socket.c
--- a/sys/compat/linux/common/linux_socket.c Mon Feb 04 04:36:41 2019 +0000
+++ b/sys/compat/linux/common/linux_socket.c Mon Feb 04 04:37:50 2019 +0000
@@ -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 @@
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;
Home |
Main Index |
Thread Index |
Old Index