-
Notifications
You must be signed in to change notification settings - Fork 783
Fix another batch of Sonar-identified issues #3148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
idodeclare
commented
May 9, 2020
- Sanitize several user-supplied strings.
- Fix some scope issues.
- Prohibit XML external access.
- Sanitize several user-supplied strings. - Fix some scope issues. - Prohibit XML external access.
@@ -561,7 +554,6 @@ private void findFilelessChildren(SkeletonDirs skels, File directory) { | |||
|
|||
/** | |||
* Counts segments arising from {@code File.separatorChar} or '\\'. | |||
* @param path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this deleted ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restored with a comment
if (value == null) { | ||
return null; | ||
} | ||
return value.replaceAll("[\\n\\r\\t\\f]", "_"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reuse the String literal ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, userInput() and luceneQuery() can be refactored into using common underlying method ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes done
|
||
HashMap<String, String[]> safes = new HashMap<>(); | ||
for (Map.Entry<String, String[]> entry : map.entrySet()) { | ||
String k = logging(entry.getKey()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String k = logging(entry.getKey()); | |
String key = logging(entry.getKey()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK done
* Represents a container for sanitizing methods for avoiding classifications as | ||
* taint bugs. | ||
*/ | ||
public class LaunderUtil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps this class should be called Laundromat and have the launder as a method ? :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, add a simple test ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You got it
I could argue about naming of Laundromat and its methods, but I guess I'll just keep smiling |
Thank you for taking a look, Lubos 😁 |
merging |
Thank you, Lubos |