Skip to content

Commit

Permalink
Guard against null namespaces
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
  • Loading branch information
jacobperron committed Mar 12, 2020
1 parent 922f2e8 commit a4b89a1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rcl/src/rcl/graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,13 @@ rcl_get_node_names(
return RCL_RET_ERROR;
}
}
// Check that none of the node namespaces are NULL
for (size_t i = 0u; i < node_names->size; ++i) {
if (!node_namespaces->data[i]) {
RCL_SET_ERROR_MSG("NULL node namespace returned by the RMW layer");
return RCL_RET_ERROR;
}
}
return RCL_RET_OK;
}

Expand Down

0 comments on commit a4b89a1

Please sign in to comment.