Skip to content

Commit

Permalink
Mojo: pack node_channel messages
Browse files Browse the repository at this point in the history
Node channel messages need to be packed.

Bug: b:172869067
Change-Id: I30ac9d44347fef9e0b74267d6d09ec8589e4d3e6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2527532
Reviewed-by: Ken Rockot <rockot@google.com>
Commit-Queue: Brian Geffon <bgeffon@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825686}
  • Loading branch information
bgaff authored and Commit Bot committed Nov 10, 2020
1 parent 961b849 commit 046a69c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mojo/core/node_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ enum class MessageType : uint32_t {
BIND_BROKER_HOST,
};

#pragma pack(push, 1)

struct Header {
MessageType type;
uint32_t padding;
Expand Down Expand Up @@ -130,6 +132,8 @@ struct EventMessageFromRelayData {
};
#endif

#pragma pack(pop)

template <typename DataType>
Channel::MessagePtr CreateMessage(MessageType type,
size_t payload_size,
Expand Down

0 comments on commit 046a69c

Please sign in to comment.