Skip to content

Commit

Permalink
issue-1020: fixing heap-buffer-overflow after #1912 (#1926)
Browse files Browse the repository at this point in the history
  • Loading branch information
qkrorlqr authored Sep 1, 2024
1 parent b808a80 commit 8e0b8c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cloud/blockstore/libs/rdma/impl/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
#include "buffer.h"
#include "event.h"
#include "list.h"
#include "log.h"
#include "poll.h"
#include "rcu.h"
#include "log.h"
#include "utils.h"
#include "verbs.h"
#include "work_queue.h"
Expand Down
11 changes: 5 additions & 6 deletions cloud/blockstore/libs/rdma/impl/test_verbs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,16 +399,15 @@ struct TTestVerbs

void ResolveAddress(
rdma_cm_id* id,
sockaddr* src_addr,
sockaddr* dst_addr,
sockaddr* srcAddr,
sockaddr* dstAddr,
TDuration timeout) override
{
Y_UNUSED(src_addr);
Y_UNUSED(dst_addr);
Y_UNUSED(timeout);

memcpy(&id->route.addr.src_storage, src_addr, sizeof(sockaddr_storage));
memcpy(&id->route.addr.dst_storage, dst_addr, sizeof(sockaddr_storage));
static_assert(sizeof(sockaddr) <= sizeof(sockaddr_storage));
memcpy(&id->route.addr.src_storage, srcAddr, sizeof(sockaddr));
memcpy(&id->route.addr.dst_storage, dstAddr, sizeof(sockaddr));

EnqueueConnectionEvent(TestContext, RDMA_CM_EVENT_ADDR_RESOLVED, id);
}
Expand Down

0 comments on commit 8e0b8c6

Please sign in to comment.