Skip to content

Commit

Permalink
Fix UB in right shift (ydb-platform#10422)
Browse files Browse the repository at this point in the history
  • Loading branch information
yumkam authored Oct 16, 2024
1 parent 0025e00 commit a4c9ddf
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ydb/library/yql/udfs/common/ip_base/lib/ip_base_udf.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ namespace {
}

static TRawIp6 MaskFromPrefix(ui8 prefix) {
ui128 x = ui128(-1) << int(128 - prefix);
if (prefix == 0) x = 0;
ui128 x = prefix == 0 ? ui128(0) : ui128(-1) << int(128 - prefix);
return FromIpAddress({x, TIpv6Address::Ipv6});
}

Expand Down

0 comments on commit a4c9ddf

Please sign in to comment.