Skip to content

Commit

Permalink
Fix NULL read from RPL header addition
Browse files Browse the repository at this point in the history
There is a possibility that the function rpl_data_exthdr_provider_hbh
was called with NULL Neighbor info causing an NULL pointer read
when adding headers to routed packets
  • Loading branch information
Mika Tervonen authored and Mika Tervonen committed Apr 15, 2021
1 parent 7802c7e commit 4371462
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions source/RPL/rpl_upward.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,9 @@ bool rpl_neighbour_update_dtsn(rpl_neighbour_t *neighbour, uint8_t dtsn)

rpl_instance_t *rpl_neighbour_instance(const rpl_neighbour_t *neighbour)
{
if (!neighbour || !neighbour->dodag_version || !neighbour->dodag_version->dodag) {
return NULL;
}
return neighbour->dodag_version->dodag->instance;
}

Expand Down

0 comments on commit 4371462

Please sign in to comment.