Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checking received data size and reject if not match. #586

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class HomestoreConan(ConanFile):
name = "homestore"
version = "6.5.11"
version = "6.5.12"

homepage = "https://github.com/eBay/Homestore"
description = "HomeStore Storage Engine"
Expand Down
8 changes: 6 additions & 2 deletions src/lib/replication/repl_dev/raft_repl_dev.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,12 @@ void RaftReplDev::on_push_data_received(intrusive< sisl::GenericRpcData >& rpc_d
auto const fb_size =
flatbuffers::ReadScalar< flatbuffers::uoffset_t >(incoming_buf.cbytes()) + sizeof(flatbuffers::uoffset_t);
auto push_req = GetSizePrefixedPushDataRequest(incoming_buf.cbytes());
HS_DBG_ASSERT_EQ(fb_size + push_req->data_size(), incoming_buf.size(), "Size mismatch of data size vs buffer size");

if (fb_size + push_req->data_size() != incoming_buf.size()) {
RD_LOGW("Data Channel: PushData received with size mismatch, header size {}, data size {}, received size {}",
fb_size, push_req->data_size(), incoming_buf.size());
rpc_data->send_response();
return;
}
sisl::blob header = sisl::blob{push_req->user_header()->Data(), push_req->user_header()->size()};
sisl::blob key = sisl::blob{push_req->user_key()->Data(), push_req->user_key()->size()};
repl_key rkey{.server_id = push_req->issuer_replica_id(), .term = push_req->raft_term(), .dsn = push_req->dsn()};
Expand Down
Loading