Defensive programming: check for the argument being NULL.

This commit is contained in:
Adam Dunkels 2013-08-12 00:19:12 +02:00 committed by Simon Duquennoy
parent b42ccaed1b
commit c52fc2fd19
3 changed files with 28 additions and 4 deletions

View file

@ -1022,6 +1022,10 @@ rpl_local_repair(rpl_instance_t *instance)
{
int i;
if(instance == NULL) {
PRINTF("RPL: local repair requested for instance NULL\n");
return;
}
PRINTF("RPL: Starting a local instance repair\n");
for(i = 0; i < RPL_MAX_DAG_PER_INSTANCE; i++) {
if(instance->dag_table[i].used) {