Module Name:    src
Committed By:   riastradh
Date:           Sun Jun 30 16:35:19 UTC 2024

Modified Files:
        src/sys/dev/usb: if_url.c

Log Message:
url(4): uint32_t for 32-bit hash so h>>31 becomes 0/1, not +1/-1.

Should avoid buffer overrun in PR 58382.


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/dev/usb/if_url.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/if_url.c
diff -u src/sys/dev/usb/if_url.c:1.97 src/sys/dev/usb/if_url.c:1.98
--- src/sys/dev/usb/if_url.c:1.97	Sat Aug 20 14:08:59 2022
+++ src/sys/dev/usb/if_url.c	Sun Jun 30 16:35:19 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_url.c,v 1.97 2022/08/20 14:08:59 riastradh Exp $	*/
+/*	$NetBSD: if_url.c,v 1.98 2024/06/30 16:35:19 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002
@@ -44,7 +44,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_url.c,v 1.97 2022/08/20 14:08:59 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_url.c,v 1.98 2024/06/30 16:35:19 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -422,7 +422,7 @@ url_uno_mcast(struct ifnet *ifp)
 	struct ether_multi *enm;
 	struct ether_multistep step;
 	uint32_t mchash[2] = { 0, 0 };
-	int h = 0, rcr;
+	uint32_t h = 0, rcr;
 
 	DPRINTF(("%s: %s: enter\n", device_xname(un->un_dev), __func__));
 

Reply via email to