Skip to content

Commit 4371462

Browse files
Mika TervonenMika Tervonen
authored andcommitted
Fix NULL read from RPL header addition
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
1 parent 7802c7e commit 4371462

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

source/RPL/rpl_upward.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,9 @@ bool rpl_neighbour_update_dtsn(rpl_neighbour_t *neighbour, uint8_t dtsn)
533533

534534
rpl_instance_t *rpl_neighbour_instance(const rpl_neighbour_t *neighbour)
535535
{
536+
if (!neighbour || !neighbour->dodag_version || !neighbour->dodag_version->dodag) {
537+
return NULL;
538+
}
536539
return neighbour->dodag_version->dodag->instance;
537540
}
538541

0 commit comments

Comments
 (0)