Skip to content

Commit

Permalink
Merge pull request #573 from NASA-PDS/alert-autofix-155
Browse files Browse the repository at this point in the history
Fix code scanning alert no. 155: Log Injection
jordanpadams authored Dec 11, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents c5f869e + ca99771 commit 90ea3a6
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -339,7 +339,8 @@ public RegistrySearchRequestBuilder constrainByQueryString(String q) throws Unpa
}
return this;
} catch (RecognitionException | ParseCancellationException e) {
log.info("Unable to parse q " + q + "error message is " + e);
String sanitizedQ = q.replace('\n', ' ').replace('\r', ' ');
log.info("Unable to parse q " + sanitizedQ + " error message is " + e);
throw new UnparsableQParamException(
"q string value:" + q + " Error message " + e.getMessage());
}

0 comments on commit 90ea3a6

Please sign in to comment.