git: 88284368fa6b - main - ifconfig: Shift unsigned value to avoid UB.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 20 Jul 2023 17:56:08 UTC
The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=88284368fa6b25b9f7b601876794a9f5304ae59f commit 88284368fa6b25b9f7b601876794a9f5304ae59f Author: Navdeep Parhar <np@FreeBSD.org> AuthorDate: 2023-07-20 17:42:15 +0000 Commit: Navdeep Parhar <np@FreeBSD.org> CommitDate: 2023-07-20 17:54:56 +0000 ifconfig: Shift unsigned value to avoid UB. Reported by: kib@ --- sbin/ifconfig/ifconfig_netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/ifconfig/ifconfig_netlink.c b/sbin/ifconfig/ifconfig_netlink.c index 0f449b7aae44..d2e3863079e7 100644 --- a/sbin/ifconfig/ifconfig_netlink.c +++ b/sbin/ifconfig/ifconfig_netlink.c @@ -88,7 +88,7 @@ print_bits(const char *btype, uint32_t *v, const int v_count, int num = 0; for (int i = 0; i < v_count * 32; i++) { - bool is_set = v[i / 32] & (1 << (i % 32)); + bool is_set = v[i / 32] & (1U << (i % 32)); if (is_set) { if (num++ == 0) printf("<");