Skip to content

Commit a4b89a1

Browse files
committed
Guard against null namespaces
Signed-off-by: Jacob Perron <[email protected]>
1 parent 922f2e8 commit a4b89a1

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

rcl/src/rcl/graph.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,13 @@ rcl_get_node_names(
352352
return RCL_RET_ERROR;
353353
}
354354
}
355+
// Check that none of the node namespaces are NULL
356+
for (size_t i = 0u; i < node_names->size; ++i) {
357+
if (!node_namespaces->data[i]) {
358+
RCL_SET_ERROR_MSG("NULL node namespace returned by the RMW layer");
359+
return RCL_RET_ERROR;
360+
}
361+
}
355362
return RCL_RET_OK;
356363
}
357364

0 commit comments

Comments
 (0)