Skip to content

Commit

Permalink
CASSINI-24885:Adding null check for request_id (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
shefalikamal authored Nov 19, 2024
1 parent 3c3d7dd commit 53607f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions examples/sgx_token/sgx_token.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ int main(int argc, char *argv[])
return 1;
}

if (request_id != NULL && 0 != validate_request_id(request_id))
{
ERROR("ERROR: Request ID should be atmost 128 characters long and should contain only alphanumeric characters, _, space, -, ., / or \\");
return 1;
}

char *ids[] = {policy_id};
policies.ids = ids;
policies.count = 1;
Expand Down
2 changes: 1 addition & 1 deletion examples/tdx_token/tdx_token.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ int main(int argc, char *argv[])
return 1;
}

if (0 != validate_request_id(request_id))
if (request_id != NULL && 0 != validate_request_id(request_id))
{
ERROR("ERROR: Request ID should be atmost 128 characters long and should contain only alphanumeric characters, _, space, -, ., / or \\");
return 1;
Expand Down

0 comments on commit 53607f7

Please sign in to comment.