diff options
author | Björn Wennmann <118190520+wennmbj@users.noreply.github.com> | 2024-05-15 18:18:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-15 17:18:47 +0100 |
commit | 7bd8690173d8c45d17598ebccc8472322b1451c7 (patch) | |
tree | 65f4e26a98f47f58d597ea11055fc8fa596e2137 | |
parent | cf497232adf84f55947f7a24e1b64e04b49f1f38 (diff) | |
download | vsomeip-upstream-master.tar.gz |
Fix netlink_connector bit shift in netmask ipv6 (#696)upstream-master
Shifting more than 31 bit was possible which may lead to
undefined behaviour
-rw-r--r-- | implementation/endpoints/src/netlink_connector.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/implementation/endpoints/src/netlink_connector.cpp b/implementation/endpoints/src/netlink_connector.cpp index 0d99ec7f..f81e0aba 100644 --- a/implementation/endpoints/src/netlink_connector.cpp +++ b/implementation/endpoints/src/netlink_connector.cpp @@ -425,7 +425,7 @@ bool netlink_connector::check_sd_multicast_route_match(struct rtmsg* _routemsg, if (i > 95) { netmask2[0] |= static_cast<std::uint32_t>(1 << (i-96)); } else if (i > 63) { - netmask2[1] |= static_cast<std::uint32_t>(1 << (i-63)); + netmask2[1] |= static_cast<std::uint32_t>(1 << (i-64)); } else if (i > 31) { netmask2[2] |= static_cast<std::uint32_t>(1 << (i-32)); } else { |