Skip to content

Commit

Permalink
Address reviewer comment
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
  • Loading branch information
ivanpauno committed Mar 27, 2020
1 parent 46322dc commit 000e2e3
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
Expand Up @@ -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;
}

Expand Down

0 comments on commit 000e2e3

Please sign in to comment.