Skip to content

Commit 129cda0

Browse files
committed
get a few more queries in sync with other languages
1 parent acfcc4b commit 129cda0

File tree

9 files changed

+86
-86
lines changed

9 files changed

+86
-86
lines changed

java/ql/src/Likely Bugs/Nullness/NullAlways.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ private import semmle.code.java.dataflow.Nullness
1717

1818
from VarAccess access, SsaSourceVariable var
1919
where alwaysNullDeref(var, access)
20-
select access, "Variable $@ is always null at this access.", var.getVariable(),
20+
select access, "Variable $@ is always null at this dereference.", var.getVariable(),
2121
var.getVariable().getName()

java/ql/src/Security/CWE/CWE-078/ExecTainted.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ import DataFlow::PathGraph
2020

2121
from DataFlow::PathNode source, DataFlow::PathNode sink, ArgumentToExec execArg
2222
where execTainted(source, sink, execArg)
23-
select execArg, source, sink, "Command line depends on a $@.", source.getNode(),
23+
select execArg, source, sink, "This command line depends on a $@.", source.getNode(),
2424
"user-provided value"

java/ql/src/Security/CWE/CWE-078/ExecTaintedLocal.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ from
3838
DataFlow::PathNode source, DataFlow::PathNode sink, ArgumentToExec execArg,
3939
LocalUserInputToArgumentToExecFlowConfig conf
4040
where conf.hasFlowPath(source, sink) and sink.getNode().asExpr() = execArg
41-
select execArg, source, sink, "Command line depends on a $@.", source.getNode(),
41+
select execArg, source, sink, "This command line depends on a $@.", source.getNode(),
4242
"user-provided value"

java/ql/src/Security/CWE/CWE-090/LdapInjection.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ import DataFlow::PathGraph
1818

1919
from DataFlow::PathNode source, DataFlow::PathNode sink, LdapInjectionFlowConfig conf
2020
where conf.hasFlowPath(source, sink)
21-
select sink.getNode(), source, sink, "LDAP query depends on a $@.", source.getNode(),
21+
select sink.getNode(), source, sink, "This LDAP query depends on a $@.", source.getNode(),
2222
"user-provided value"

java/ql/src/experimental/Security/CWE/CWE-078/ExecTainted.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ import DataFlow::PathGraph
2121
// This is a clone of query `java/command-line-injection` that also includes experimental sinks.
2222
from DataFlow::PathNode source, DataFlow::PathNode sink, ArgumentToExec execArg
2323
where execTainted(source, sink, execArg)
24-
select execArg, source, sink, "Command line depends on a $@.", source.getNode(),
24+
select execArg, source, sink, "This command line depends on a $@.", source.getNode(),
2525
"user-provided value"

java/ql/test/experimental/query-tests/security/CWE-078/ExecTainted.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ nodes
88
| JSchOSInjectionTest.java:53:36:53:52 | ... + ... | semmle.label | ... + ... |
99
subpaths
1010
#select
11-
| JSchOSInjectionTest.java:27:52:27:68 | ... + ... | JSchOSInjectionTest.java:14:30:14:60 | getParameter(...) : String | JSchOSInjectionTest.java:27:52:27:68 | ... + ... | Command line depends on a $@. | JSchOSInjectionTest.java:14:30:14:60 | getParameter(...) | user-provided value |
12-
| JSchOSInjectionTest.java:53:36:53:52 | ... + ... | JSchOSInjectionTest.java:40:30:40:60 | getParameter(...) : String | JSchOSInjectionTest.java:53:36:53:52 | ... + ... | Command line depends on a $@. | JSchOSInjectionTest.java:40:30:40:60 | getParameter(...) | user-provided value |
11+
| JSchOSInjectionTest.java:27:52:27:68 | ... + ... | JSchOSInjectionTest.java:14:30:14:60 | getParameter(...) : String | JSchOSInjectionTest.java:27:52:27:68 | ... + ... | This command line depends on a $@. | JSchOSInjectionTest.java:14:30:14:60 | getParameter(...) | user-provided value |
12+
| JSchOSInjectionTest.java:53:36:53:52 | ... + ... | JSchOSInjectionTest.java:40:30:40:60 | getParameter(...) : String | JSchOSInjectionTest.java:53:36:53:52 | ... + ... | This command line depends on a $@. | JSchOSInjectionTest.java:40:30:40:60 | getParameter(...) | user-provided value |
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
| A.java:15:7:15:9 | not | Variable $@ is always null at this access. | A.java:13:5:13:22 | Object not | not |
2-
| A.java:97:18:97:36 | synchronized_always | Variable $@ is always null at this access. | A.java:96:5:96:38 | Object synchronized_always | synchronized_always |
3-
| A.java:161:26:161:34 | do_always | Variable $@ is always null at this access. | A.java:159:5:159:28 | String do_always | do_always |
4-
| A.java:167:26:167:34 | do_maybe1 | Variable $@ is always null at this access. | A.java:165:5:165:28 | String do_maybe1 | do_maybe1 |
5-
| A.java:187:26:187:37 | while_always | Variable $@ is always null at this access. | A.java:185:5:185:31 | String while_always | while_always |
6-
| A.java:207:26:207:34 | if_always | Variable $@ is always null at this access. | A.java:205:5:205:28 | String if_always | if_always |
7-
| A.java:223:24:223:29 | for_ok | Variable $@ is always null at this access. | A.java:219:5:219:19 | String for_ok | for_ok |
8-
| A.java:226:26:226:35 | for_always | Variable $@ is always null at this access. | A.java:225:10:225:33 | String for_always | for_always |
9-
| A.java:236:5:236:14 | array_null | Variable $@ is always null at this access. | A.java:235:5:235:28 | int[] array_null | array_null |
10-
| A.java:248:24:248:34 | arrayaccess | Variable $@ is always null at this access. | A.java:244:5:244:29 | int[] arrayaccess | arrayaccess |
11-
| A.java:249:24:249:34 | fieldaccess | Variable $@ is always null at this access. | A.java:245:5:245:32 | String[] fieldaccess | fieldaccess |
12-
| A.java:250:24:250:35 | methodaccess | Variable $@ is always null at this access. | A.java:246:5:246:31 | Object methodaccess | methodaccess |
13-
| A.java:264:21:264:30 | for_always | Variable $@ is always null at this access. | A.java:263:5:263:35 | List<String> for_always | for_always |
14-
| A.java:266:24:266:33 | for_always | Variable $@ is always null at this access. | A.java:263:5:263:35 | List<String> for_always | for_always |
15-
| A.java:293:5:293:5 | s | Variable $@ is always null at this access. | A.java:291:5:291:33 | Object s | s |
16-
| B.java:304:7:304:9 | ioe | Variable $@ is always null at this access. | B.java:297:5:297:25 | Exception ioe | ioe |
1+
| A.java:15:7:15:9 | not | Variable $@ is always null at this dereference. | A.java:13:5:13:22 | Object not | not |
2+
| A.java:97:18:97:36 | synchronized_always | Variable $@ is always null at this dereference. | A.java:96:5:96:38 | Object synchronized_always | synchronized_always |
3+
| A.java:161:26:161:34 | do_always | Variable $@ is always null at this dereference. | A.java:159:5:159:28 | String do_always | do_always |
4+
| A.java:167:26:167:34 | do_maybe1 | Variable $@ is always null at this dereference. | A.java:165:5:165:28 | String do_maybe1 | do_maybe1 |
5+
| A.java:187:26:187:37 | while_always | Variable $@ is always null at this dereference. | A.java:185:5:185:31 | String while_always | while_always |
6+
| A.java:207:26:207:34 | if_always | Variable $@ is always null at this dereference. | A.java:205:5:205:28 | String if_always | if_always |
7+
| A.java:223:24:223:29 | for_ok | Variable $@ is always null at this dereference. | A.java:219:5:219:19 | String for_ok | for_ok |
8+
| A.java:226:26:226:35 | for_always | Variable $@ is always null at this dereference. | A.java:225:10:225:33 | String for_always | for_always |
9+
| A.java:236:5:236:14 | array_null | Variable $@ is always null at this dereference. | A.java:235:5:235:28 | int[] array_null | array_null |
10+
| A.java:248:24:248:34 | arrayaccess | Variable $@ is always null at this dereference. | A.java:244:5:244:29 | int[] arrayaccess | arrayaccess |
11+
| A.java:249:24:249:34 | fieldaccess | Variable $@ is always null at this dereference. | A.java:245:5:245:32 | String[] fieldaccess | fieldaccess |
12+
| A.java:250:24:250:35 | methodaccess | Variable $@ is always null at this dereference. | A.java:246:5:246:31 | Object methodaccess | methodaccess |
13+
| A.java:264:21:264:30 | for_always | Variable $@ is always null at this dereference. | A.java:263:5:263:35 | List<String> for_always | for_always |
14+
| A.java:266:24:266:33 | for_always | Variable $@ is always null at this dereference. | A.java:263:5:263:35 | List<String> for_always | for_always |
15+
| A.java:293:5:293:5 | s | Variable $@ is always null at this dereference. | A.java:291:5:291:33 | Object s | s |
16+
| B.java:304:7:304:9 | ioe | Variable $@ is always null at this dereference. | B.java:297:5:297:25 | Exception ioe | ioe |

java/ql/test/query-tests/security/CWE-078/ExecTaintedLocal.expected

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ nodes
3333
| Test.java:61:23:61:25 | arg : String | semmle.label | arg : String |
3434
subpaths
3535
#select
36-
| Test.java:7:44:7:69 | ... + ... | Test.java:57:27:57:39 | args : String[] | Test.java:7:44:7:69 | ... + ... | Command line depends on a $@. | Test.java:57:27:57:39 | args | user-provided value |
37-
| Test.java:10:29:10:74 | new String[] | Test.java:57:27:57:39 | args : String[] | Test.java:10:29:10:74 | new String[] | Command line depends on a $@. | Test.java:57:27:57:39 | args | user-provided value |
38-
| Test.java:18:29:18:31 | cmd | Test.java:57:27:57:39 | args : String[] | Test.java:18:29:18:31 | cmd | Command line depends on a $@. | Test.java:57:27:57:39 | args | user-provided value |
39-
| Test.java:24:29:24:32 | cmd1 | Test.java:57:27:57:39 | args : String[] | Test.java:24:29:24:32 | cmd1 | Command line depends on a $@. | Test.java:57:27:57:39 | args | user-provided value |
40-
| Test.java:29:44:29:64 | ... + ... | Test.java:57:27:57:39 | args : String[] | Test.java:29:44:29:64 | ... + ... | Command line depends on a $@. | Test.java:57:27:57:39 | args | user-provided value |
36+
| Test.java:7:44:7:69 | ... + ... | Test.java:57:27:57:39 | args : String[] | Test.java:7:44:7:69 | ... + ... | This command line depends on a $@. | Test.java:57:27:57:39 | args | user-provided value |
37+
| Test.java:10:29:10:74 | new String[] | Test.java:57:27:57:39 | args : String[] | Test.java:10:29:10:74 | new String[] | This command line depends on a $@. | Test.java:57:27:57:39 | args | user-provided value |
38+
| Test.java:18:29:18:31 | cmd | Test.java:57:27:57:39 | args : String[] | Test.java:18:29:18:31 | cmd | This command line depends on a $@. | Test.java:57:27:57:39 | args | user-provided value |
39+
| Test.java:24:29:24:32 | cmd1 | Test.java:57:27:57:39 | args : String[] | Test.java:24:29:24:32 | cmd1 | This command line depends on a $@. | Test.java:57:27:57:39 | args | user-provided value |
40+
| Test.java:29:44:29:64 | ... + ... | Test.java:57:27:57:39 | args : String[] | Test.java:29:44:29:64 | ... + ... | This command line depends on a $@. | Test.java:57:27:57:39 | args | user-provided value |

0 commit comments

Comments
 (0)