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:
parent
bbb7a5b327
commit
9175f4f04a
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user