Skip to content

Commit

Permalink
fix(split): message header should not be empty (XiaoMi#725)
Browse files Browse the repository at this point in the history
  • Loading branch information
hycdong authored and zhangyifan27 committed Jan 25, 2021
1 parent 9b98a65 commit 51bdd07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/rpc/rpc_message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ message_ex *message_ex::copy_message_no_reply(const message_ex &old_msg)
static_cast<char *>(dsn::tls_trans_malloc(sizeof(message_header))),
[](char *c) { dsn::tls_trans_free(c); });
msg->header = reinterpret_cast<message_header *>(header_holder.get());
msg->header = {}; // initialize to empty struct
memset(static_cast<void *>(msg->header), 0, sizeof(message_header));
msg->buffers.emplace_back(blob(std::move(header_holder), sizeof(message_header)));

if (old_msg.buffers.size() == 1) {
Expand Down

0 comments on commit 51bdd07

Please sign in to comment.