diff options
author | Ilya A. Evenbach <ievenbach@aurora.tech> | 2024-04-22 12:39:24 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2024-04-26 06:54:39 (GMT) |
commit | 46cae1bfc2ee435fed7c73a15d0b6979fe6d43a3 (patch) | |
tree | 39f8de5afd0e6f13787c999e61983b543126ef28 | |
parent | 96ddcd999297d8697235e75417bda8a66e26bb0f (diff) | |
download | libnl-46cae1bfc2ee435fed7c73a15d0b6979fe6d43a3.zip libnl-46cae1bfc2ee435fed7c73a15d0b6979fe6d43a3.tar.gz libnl-46cae1bfc2ee435fed7c73a15d0b6979fe6d43a3.tar.bz2 |
socket: fix ubsan complaint about incorrect left-shift in generate_local_port()
n needs to be uint32_t to fit left shift by 22 bits
https://github.com/thom311/libnl/pull/379
-rw-r--r-- | lib/socket.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/socket.c b/lib/socket.c index 9b42f67..742cdac 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -84,7 +84,7 @@ static NL_RW_LOCK(port_map_lock); static uint32_t generate_local_port(void) { int i, j, m; - uint16_t n; + uint32_t n; static uint16_t idx_state = 0; uint32_t pid = getpid() & 0x3FFFFF; |