8000 Java: Add new quality query to detect `String#replaceAll` with non-regex first argument by owen-mc · Pull Request #19115 · github/codeql · GitHub
[go: up one dir, main page]

Skip to content

Java: Add new quality query to detect String#replaceAll with non-regex first argument #19115

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

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Keep COMPLIANT and NON_COMPLIANT comments in test
  • Loading branch information
owen-mc committed Apr 10, 2025
commit e1c5517de71b8f73338c9dcd02582ddb20a03dcb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
public class Test {
void f() {
String s1 = "test";
s1 = s1.replaceAll("t", "x"); // $ Alert
s1 = s1.replaceAll(".*", "x");
s1 = s1.replaceAll("t", "x"); // $ Alert // NON_COMPLIANT
s1 = s1.replaceAll(".*", "x"); // COMPLIANT
}
}
0