Skip to content

Commit

Permalink
Fix netlink_connector bit shift in netmask ipv6 (#696)
Browse files Browse the repository at this point in the history
Shifting more than 31 bit was possible which may lead to
undefined behaviour
  • Loading branch information
wennmbj committed May 15, 2024
1 parent cf49723 commit 7bd8690
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion implementation/endpoints/src/netlink_connector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 7bd8690

Please sign in to comment.