github-code-scanning[bot] commented on code in PR #70:
URL:
https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/70#discussion_r890111671
##########
src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java:
##########
@@ -709,10 +718,29 @@
private List<MapEntry> getMapEntryList(String vanityPath) {
List<MapEntry> mapEntries = null;
- if (!vanityPathsProcessed.get() ||
BloomFilterUtils.probablyContains(vanityBloomFilter, vanityPath)) {
+ boolean initFinished = vanityPathsProcessed.get();
+ boolean probablyPresent = false;
+
+ if (initFinished) {
+ // total number of lookups after init (and when cache not complete)
+ this.vanityPathLookups.incrementAndGet();
+
+ // init is done - check the bloom filter
+ probablyPresent =
BloomFilterUtils.probablyContains(vanityBloomFilter, vanityPath);
+ log.trace("bloom filter lookup for {} -> {}", vanityPath,
probablyPresent);
Review Comment:
## Logging should not be vulnerable to injection attacks
<!--SONAR_ISSUE_KEY:AYEVULZxK3ycU8sEOzC0-->Change this code to not log
user-controlled data.
[Show more
details](https://github.com/apache/sling-org-apache-sling-resourceresolver/security/code-scanning/19)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]