Skip to content

Commit

Permalink
Fixed an issue where a crash occurred when the policy value was empty…
Browse files Browse the repository at this point in the history
… in SignedPolicy
  • Loading branch information
choigilhoon committed Oct 14, 2024
1 parent a65c593 commit 83cb9c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ bool SignedPolicy::Process(const std::shared_ptr<const ac::RequestInfo> &request

// Extract policy
auto policy_base64 = url->GetQueryValue(policy_query_key);
if (policy_base64.IsEmpty())
{
SetError(ErrCode::NO_POLICY_VALUE_IN_URL, ov::String::FormatString("Policy value is empty in url(%s).", request_url_str.CStr()));
return false;
}

auto policy = ov::Base64::Decode(policy_base64, true);

if (ProcessPolicyJson(policy->ToString()) == false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class SignedPolicy
INIT = 0,
PASSED = 1,
NO_POLICY_KEY_IN_URL,
NO_POLICY_VALUE_IN_URL,
NO_SIGNATURE_KEY_IN_URL,
NO_SIGNATURE_VALUE_IN_URL,
INVALID_SIGNATURE,
Expand Down

0 comments on commit 83cb9c8

Please sign in to comment.