netresolv: Merge patches from 2015 to current HEAD.

Commits merged from the semi-official Git mirror of NetBSD
trunk (https://github.com/IIJ-NetBSD/netbsd-src/).

Commit authors/messages in chronological order follow:
---------------------------------------
From: maya <maya@netbsd.org>
Date: Tue, 9 May 2017 02:56:44 +0000
Subject: Avoid shift of negative signed integer. this is UB. NFC.
This commit is contained in:
Augustin Cavalier 2017-07-03 12:17:47 -04:00
parent bbb7a5b327
commit 9175f4f04a
2 changed files with 3 additions and 3 deletions

View File

@ -20,7 +20,7 @@
#ifdef notdef
static const char rcsid[] = "Id: inet_net_ntop.c,v 1.1.2.1 2002/08/02 02:17:21 marka Exp ";
#else
__RCSID("$NetBSD: inet_net_ntop.c,v 1.3 2012/03/20 17:08:13 matt Exp $");
__RCSID("$NetBSD: inet_net_ntop.c,v 1.4 2017/05/09 02:56:44 maya Exp $");
#endif
#endif
@ -198,7 +198,7 @@ inet_net_ntop_ipv6(const u_char *src, int bits, char *dst, size_t size)
memset(inbuf + p, 0, 16 - p);
b = bits % 8;
if (b != 0) {
m = ~0 << (8 - b);
m = ~0u << (8 - b);
inbuf[p-1] &= m;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: res_init.c,v 1.30 2015/02/24 17:56:20 christos Exp $ */
/* $NetBSD: res_init.c,v 1.31 2017/04/19 22:21:07 christos Exp $ */
/*
* Copyright (c) 1985, 1989, 1993