Skip to content

Commit 90cabef

Browse files
authored
Merge pull request #176 from jthiltges/pr/badjwks
Fix segfault if the JSON parser cannot parse the JWKS
2 parents e21b2a3 + a504da4 commit 90cabef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/scitokens_internal.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,12 +734,12 @@ std::unique_ptr<AsyncStatus> Validator::get_public_keys_from_web_continue(
734734
auto metadata = std::string(buffer, len);
735735
picojson::value json_obj;
736736
auto err = picojson::parse(json_obj, metadata);
737-
status->m_cget.reset();
738737
if (!err.empty()) {
739738
throw JsonException("JSON parse failure when downloading from the "
740739
" public key URL " +
741740
status->m_cget->get_url() + ": " + err);
742741
}
742+
status->m_cget.reset();
743743

744744
auto now = std::time(NULL);
745745
// TODO: take expiration time from the cache-control header in the

0 commit comments

Comments
 (0)