Skip to content

java inline expectations proof-of-concept with tests #16911

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
add test for extensible predicate in postprocess
  • Loading branch information
ginsbach committed Jul 16, 2024
commit fba8ebe28b1e63eb5f3f3728eb09b09a83eb4096
17 changes: 17 additions & 0 deletions java/ql/test/TestUtilities/SinkModelNamespaceRoots.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* @kind test-postprocess
*/

import semmle.code.java.dataflow.ExternalFlow

string sinkModuleNamespaceRoots() {
exists(string namespace, int dotIdx |
sinkModel(namespace, _, _, _, _, _, _, _, _, _) and
dotIdx = namespace.indexOf(".", 0, 0) and
result = namespace.substring(0, dotIdx)
)
}

from int line, string content
where content = rank[line](string c | c = sinkModuleNamespaceRoots() | c)
select "#select", line, 0, content
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
| android |
| androidx |
| ch |
| com |
| freemarker |
| groovy |
| hudson |
| io |
| jakarta |
| java |
| javafx |
| javax |
| kotlin |
| liquibase |
| net |
| ognl |
| org |
| play |
| sun |
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
query: Security/CWE/CWE-020/OverlyLargeRange.ql
postprocess: TestUtilities/SinkModelNamespaceRoots.ql
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy