Skip to content

Commit

Permalink
Fix incorrect version reporting in Virtualbox LOG_WARNING.
Browse files Browse the repository at this point in the history
Found by Coverity. This is clearly wrong. It's trying to do a bitwise AND mask
of the bottom 16 bits but was incorrectly using a logical and.
Part of #2996
  • Loading branch information
weirddan455 authored and kcgen committed Oct 14, 2023
1 parent 723c64f commit 561d218
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hardware/virtualbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ static void warn_unsupported_struct_version(const RequestHeader& header)
LOG_WARNING("VIRTUALBOX: unimplemented request #%d structure v%d.%02d",
enum_val(header.request_type),
header.struct_version >> 16,
header.struct_version && 0xffff);
header.struct_version & 0xffff);
already_warned_set.insert(header.struct_version);
}
}
Expand Down Expand Up @@ -467,7 +467,7 @@ static void handle_report_guest_info(const RequestHeader& header,
if (payload.interface_version != ver_1_04) {
LOG_WARNING("VIRTUALBOX: unimplemented protocol v%d.%02d",
payload.interface_version >> 16,
payload.interface_version && 0xffff);
payload.interface_version & 0xffff);
client_disconnect();
break;
}
Expand Down

0 comments on commit 561d218

Please sign in to comment.