Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Address reviewer comment
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Santiago Paunovic <[email protected]>
ivanpauno committed Mar 26, 2020
1 parent 35ec36e commit 675e4d5
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions rcl/src/rcl/validate_security_context_name.c
Original file line number Diff line number Diff line change
@@ -109,10 +109,15 @@ rcl_validate_security_context_name_with_size(
}

// security_context might be longer that namespace length, check false positives and correct
if (tmp_validation_result == RMW_NAMESPACE_INVALID_TOO_LONG &&
security_context_length <= RCL_SECURITY_CONTEXT_NAME_MAX_LENGTH)
{
*validation_result = RCL_SECURITY_CONTEXT_NAME_VALID;
if (RMW_NAMESPACE_INVALID_TOO_LONG == tmp_validation_result) {
if (RCL_SECURITY_CONTEXT_NAME_MAX_LENGTH >= security_context_length) {
*validation_result = RCL_SECURITY_CONTEXT_NAME_VALID;
} else {
*validation_result = RCL_SECURITY_CONTEXT_NAME_INVALID_TOO_LONG;
if (invalid_index) {
*invalid_index = RCL_SECURITY_CONTEXT_NAME_MAX_LENGTH - 1;
}
}
return RCL_RET_OK;
}

0 comments on commit 675e4d5

Please sign in to comment.