Skip to content

Commit

Permalink
Bug 1865046 - Check ProtocolId cast in IPC fuzzer. r=truber
Browse files Browse the repository at this point in the history
  • Loading branch information
choller committed Nov 27, 2023
1 parent a4d0df0 commit 76269b7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tools/fuzzing/ipc/IPCFuzzController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,12 @@ bool IPCFuzzController::MakeTargetDecision(
} else if (isPreserveHeader) {
// In preserveHeaderMode, we need to find an actor that matches the
// requested message type instead of any random actor.
ProtocolId wantedProtocolId = static_cast<ProtocolId>(*type >> 16);
uint16_t maybeProtocolId = *type >> 16;
if (maybeProtocolId >= IPCMessageStart::LastMsgIndex) {
// Not a valid protocol.
return false;
}
ProtocolId wantedProtocolId = static_cast<ProtocolId>(maybeProtocolId);
std::vector<uint32_t> allowedIndices;
for (uint32_t i = 0; i < actors.size(); ++i) {
if (actors[i].second == wantedProtocolId) {
Expand Down

0 comments on commit 76269b7

Please sign in to comment.