Skip to content

Commit

Permalink
Fix possible memcpy overlap
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulStoffregen committed Sep 16, 2022
1 parent ac160f1 commit 5ecb8da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion RHRouter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ RHRouter::RoutingTableEntry* RHRouter::getRouteTo(uint8_t dest)
void RHRouter::deleteRoute(uint8_t index)
{
// Delete a route by copying following routes on top of it
memcpy(&_routes[index], &_routes[index+1],
memmove(&_routes[index], &_routes[index+1],
sizeof(RoutingTableEntry) * (RH_ROUTING_TABLE_SIZE - index - 1));
_routes[RH_ROUTING_TABLE_SIZE - 1].state = Invalid;
}
Expand Down

0 comments on commit 5ecb8da

Please sign in to comment.