Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jan 2021 15:11:17 GMT
From:      Alex Richardson <arichardson@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 94ac312a7168 - main - ifconfig: fix UBSan signed shift error
Message-ID:  <202101251511.10PFBHuq039567@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by arichardson:

URL: https://cgit.FreeBSD.org/src/commit/?id=94ac312a71683a3a1a928c6adfe927d6bb45044f

commit 94ac312a71683a3a1a928c6adfe927d6bb45044f
Author:     Alex Richardson <arichardson@FreeBSD.org>
AuthorDate: 2021-01-19 11:35:21 +0000
Commit:     Alex Richardson <arichardson@FreeBSD.org>
CommitDate: 2021-01-25 15:09:50 +0000

    ifconfig: fix UBSan signed shift error
    
    Use 1u since UBSan complains about 1 << 31.
---
 sbin/ifconfig/ifconfig.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index e6e7908e18cd..90a84f2996bc 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -1514,7 +1514,7 @@ printb(const char *s, unsigned v, const char *bits)
 		bits++;
 		putchar('<');
 		while ((i = *bits++) != '\0') {
-			if (v & (1 << (i-1))) {
+			if (v & (1u << (i-1))) {
 				if (any)
 					putchar(',');
 				any = 1;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202101251511.10PFBHuq039567>