Skip to content

Commit

Permalink
update two more queries to better follow the style-guide
Browse files Browse the repository at this point in the history
  • Loading branch information
erik-krogh committed Oct 1, 2022
1 parent 7d643e4 commit acfcc4b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion java/ql/src/Likely Bugs/Statements/PartiallyMaskedCatch.ql
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,4 @@ where
else multiCatchMsg = ""
select try.getCatchClause(second),
"This catch-clause is unreachable" + multiCatchMsg + "; it is masked $@.",
try.getCatchClause(first), "here for exceptions of type '" + masking.getName() + "'"
try.getCatchClause(first), "by a previous catch-clause for exceptions of type '" + masking.getName() + "'"
5 changes: 2 additions & 3 deletions java/ql/src/Security/CWE/CWE-367/TOCTOURace.ql
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,5 @@ where
not probablyNeverEscapes(r) and
// The synchronized methods on `Throwable` are not interesting.
not call1.getCallee().getDeclaringType() instanceof TypeThrowable
select call2,
"This uses the state of $@ which is checked $@. But these are not jointly synchronized.", r,
r.getName(), call1, "here"
select call2, "This uses the state of $@ which $@. But these are not jointly synchronized.", r,
r.getName(), call1, "is checked at a previous call"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
| PartiallyMaskedCatchTest.java:16:5:16:25 | catch (...) | This catch-clause is unreachable; it is masked $@. | PartiallyMaskedCatchTest.java:12:5:12:24 | catch (...) | here for exceptions of type 'ExceptionB' |
| PartiallyMaskedCatchTest.java:16:5:16:25 | catch (...) | This catch-clause is unreachable; it is masked $@. | PartiallyMaskedCatchTest.java:14:5:14:24 | catch (...) | here for exceptions of type 'ExceptionA' |
| PartiallyMaskedCatchTest.java:26:5:26:25 | catch (...) | This catch-clause is unreachable; it is masked $@. | PartiallyMaskedCatchTest.java:22:5:22:47 | catch (...) | here for exceptions of type 'ExceptionB' |
| PartiallyMaskedCatchTest.java:26:5:26:25 | catch (...) | This catch-clause is unreachable; it is masked $@. | PartiallyMaskedCatchTest.java:24:5:24:43 | catch (...) | here for exceptions of type 'ExceptionA' |
| PartiallyMaskedCatchTest.java:36:5:36:44 | catch (...) | This catch-clause is unreachable for type IOException; it is masked $@. | PartiallyMaskedCatchTest.java:32:5:32:47 | catch (...) | here for exceptions of type 'ExceptionB' |
| PartiallyMaskedCatchTest.java:36:5:36:44 | catch (...) | This catch-clause is unreachable for type IOException; it is masked $@. | PartiallyMaskedCatchTest.java:34:5:34:51 | catch (...) | here for exceptions of type 'ExceptionA' |
| PartiallyMaskedCatchTest.java:16:5:16:25 | catch (...) | This catch-clause is unreachable; it is masked $@. | PartiallyMaskedCatchTest.java:12:5:12:24 | catch (...) | by a previous catch-clause for exceptions of type 'ExceptionB' |
| PartiallyMaskedCatchTest.java:16:5:16:25 | catch (...) | This catch-clause is unreachable; it is masked $@. | PartiallyMaskedCatchTest.java:14:5:14:24 | catch (...) | by a previous catch-clause for exceptions of type 'ExceptionA' |
| PartiallyMaskedCatchTest.java:26:5:26:25 | catch (...) | This catch-clause is unreachable; it is masked $@. | PartiallyMaskedCatchTest.java:22:5:22:47 | catch (...) | by a previous catch-clause for exceptions of type 'ExceptionB' |
| PartiallyMaskedCatchTest.java:26:5:26:25 | catch (...) | This catch-clause is unreachable; it is masked $@. | PartiallyMaskedCatchTest.java:24:5:24:43 | catch (...) | by a previous catch-clause for exceptions of type 'ExceptionA' |
| PartiallyMaskedCatchTest.java:36:5:36:44 | catch (...) | This catch-clause is unreachable for type IOException; it is masked $@. | PartiallyMaskedCatchTest.java:32:5:32:47 | catch (...) | by a previous catch-clause for exceptions of type 'ExceptionB' |
| PartiallyMaskedCatchTest.java:36:5:36:44 | catch (...) | This catch-clause is unreachable for type IOException; it is masked $@. | PartiallyMaskedCatchTest.java:34:5:34:51 | catch (...) | by a previous catch-clause for exceptions of type 'ExceptionA' |
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
| Test.java:13:4:13:10 | act(...) | This uses the state of $@ which is checked $@. But these are not jointly synchronized. | Test.java:10:32:10:41 | r | r | Test.java:12:7:12:18 | getState(...) | here |
| Test.java:20:4:20:10 | act(...) | This uses the state of $@ which is checked $@. But these are not jointly synchronized. | Test.java:17:32:17:42 | r | r | Test.java:19:7:19:18 | getState(...) | here |
| Test.java:27:4:27:10 | act(...) | This uses the state of $@ which is checked $@. But these are not jointly synchronized. | Test.java:24:19:24:28 | r | r | Test.java:26:7:26:18 | getState(...) | here |
| Test.java:35:5:35:11 | act(...) | This uses the state of $@ which is checked $@. But these are not jointly synchronized. | Test.java:31:19:31:28 | r | r | Test.java:34:8:34:19 | getState(...) | here |
| Test.java:13:4:13:10 | act(...) | This uses the state of $@ which $@. But these are not jointly synchronized. | Test.java:10:32:10:41 | r | r | Test.java:12:7:12:18 | getState(...) | is checked at a previous call |
| Test.java:20:4:20:10 | act(...) | This uses the state of $@ which $@. But these are not jointly synchronized. | Test.java:17:32:17:42 | r | r | Test.java:19:7:19:18 | getState(...) | is checked at a previous call |
| Test.java:27:4:27:10 | act(...) | This uses the state of $@ which $@. But these are not jointly synchronized. | Test.java:24:19:24:28 | r | r | Test.java:26:7:26:18 | getState(...) | is checked at a previous call |
| Test.java:35:5:35:11 | act(...) | This uses the state of $@ which $@. But these are not jointly synchronized. | Test.java:31:19:31:28 | r | r | Test.java:34:8:34:19 | getState(...) | is checked at a previous call |

0 comments on commit acfcc4b

Please sign in to comment.