changeset 4297:9a20d199768b draft

Fix a promotion caught with gcc -fsanitize=undefined.
author Kamil Rytarowski <kamil@netbsd.org>
date Wed, 25 Jul 2018 01:35:52 +0100
parents 4817f6828021
children d029c1a28bcc
files src/dhcp.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/dhcp.c	Tue Jul 24 08:49:00 2018 +0100
+++ b/src/dhcp.c	Wed Jul 25 01:35:52 2018 +0100
@@ -3267,7 +3267,7 @@
 	struct bootp_pkt *p;
 
 	p = (struct bootp_pkt *)udp;
-	*len = ntohs(p->ip.ip_len) - sizeof(p->ip) - sizeof(p->udp);
+	*len = (size_t)ntohs(p->ip.ip_len) - sizeof(p->ip) - sizeof(p->udp);
 	return (char *)udp + offsetof(struct bootp_pkt, bootp);
 }