]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix a promotion caught with gcc -fsanitize=undefined.
authorKamil Rytarowski <kamil@netbsd.org>
Wed, 25 Jul 2018 00:35:52 +0000 (01:35 +0100)
committerRoy Marples <roy@marples.name>
Wed, 25 Jul 2018 00:35:52 +0000 (01:35 +0100)
src/dhcp.c

index 83c997b312d2939138415a3096e6b19e4a10c399..7a6749d40ae12d4eb9b930fb17537e63fe3fa891 100644 (file)
@@ -3267,7 +3267,7 @@ get_udp_data(void *udp, size_t *len)
        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);
 }