Skip to content

Commit f812cbd

Browse files
committed
wip
1 parent 4f7e97b commit f812cbd

File tree

4 files changed

+5
-13
lines changed

4 files changed

+5
-13
lines changed

cpp/ql/test/query-tests/Security/CWE/CWE-119/semmle/tests/OverflowDestination.expected

-4
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@ edges
55
| overflowdestination.cpp:27:2:27:15 | *... = ... | overflowdestination.cpp:30:17:30:20 | *arg1 | provenance | |
66
| overflowdestination.cpp:43:8:43:10 | fgets output argument | overflowdestination.cpp:46:15:46:17 | *src | provenance | |
77
| overflowdestination.cpp:50:52:50:54 | *src | overflowdestination.cpp:50:52:50:54 | *src | provenance | |
8-
| overflowdestination.cpp:50:52:50:54 | *src | overflowdestination.cpp:50:52:50:54 | *src [Reverse] | provenance | DataFlowFunction |
98
| overflowdestination.cpp:50:52:50:54 | *src | overflowdestination.cpp:53:15:53:17 | *src | provenance | |
109
| overflowdestination.cpp:57:52:57:54 | *src | overflowdestination.cpp:60:15:60:17 | *src | provenance | |
1110
| overflowdestination.cpp:60:15:60:17 | *src | overflowdestination.cpp:64:16:64:19 | *src2 | provenance | |
1211
| overflowdestination.cpp:73:8:73:10 | fgets output argument | overflowdestination.cpp:75:30:75:32 | *src | provenance | |
1312
| overflowdestination.cpp:73:8:73:10 | fgets output argument | overflowdestination.cpp:76:30:76:32 | *src | provenance | |
1413
| overflowdestination.cpp:75:30:75:32 | *src | overflowdestination.cpp:50:52:50:54 | *src | provenance | |
1514
| overflowdestination.cpp:75:30:75:32 | *src | overflowdestination.cpp:75:30:75:32 | overflowdest_test2 output argument | provenance | |
16-
| overflowdestination.cpp:75:30:75:32 | *src | overflowdestination.cpp:75:30:75:32 | overflowdest_test2 output argument | provenance | DataFlowFunction |
1715
| overflowdestination.cpp:75:30:75:32 | overflowdest_test2 output argument | overflowdestination.cpp:76:30:76:32 | *src | provenance | |
1816
| overflowdestination.cpp:76:30:76:32 | *src | overflowdestination.cpp:57:52:57:54 | *src | provenance | |
1917
nodes
@@ -26,7 +24,6 @@ nodes
2624
| overflowdestination.cpp:46:15:46:17 | *src | semmle.label | *src |
2725
| overflowdestination.cpp:50:52:50:54 | *src | semmle.label | *src |
2826
| overflowdestination.cpp:50:52:50:54 | *src | semmle.label | *src |
29-
| overflowdestination.cpp:50:52:50:54 | *src [Reverse] | semmle.label | *src [Reverse] |
3027
| overflowdestination.cpp:53:15:53:17 | *src | semmle.label | *src |
3128
| overflowdestination.cpp:57:52:57:54 | *src | semmle.label | *src |
3229
| overflowdestination.cpp:60:15:60:17 | *src | semmle.label | *src |
@@ -37,7 +34,6 @@ nodes
3734
| overflowdestination.cpp:76:30:76:32 | *src | semmle.label | *src |
3835
subpaths
3936
| overflowdestination.cpp:75:30:75:32 | *src | overflowdestination.cpp:50:52:50:54 | *src | overflowdestination.cpp:50:52:50:54 | *src | overflowdestination.cpp:75:30:75:32 | overflowdest_test2 output argument |
40-
| overflowdestination.cpp:75:30:75:32 | *src | overflowdestination.cpp:50:52:50:54 | *src | overflowdestination.cpp:50:52:50:54 | *src [Reverse] | overflowdestination.cpp:75:30:75:32 | overflowdest_test2 output argument |
4137
#select
4238
| overflowdestination.cpp:30:2:30:8 | call to strncpy | main.cpp:6:27:6:30 | **argv | overflowdestination.cpp:30:17:30:20 | *arg1 | To avoid overflow, this operation should be bounded by destination-buffer size, not source-buffer size. |
4339
| overflowdestination.cpp:46:2:46:7 | call to memcpy | overflowdestination.cpp:43:8:43:10 | fgets output argument | overflowdestination.cpp:46:15:46:17 | *src | To avoid overflow, this operation should be bounded by destination-buffer size, not source-buffer size. |

java/ql/test/library-tests/dataflow/capture/test.expected

-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
| A.java:23:11:23:13 | "C" : String | A.java:39:12:39:12 | a : new A(...) { ... } [String s] |
5151
| A.java:25:22:25:24 | "D" : String | A.java:4:5:4:7 | parameter this [Reverse] : Box [elem] |
5252
| A.java:25:22:25:24 | "D" : String | A.java:4:5:4:7 | this <constr(this)> [Reverse] : Box [elem] |
53-
| A.java:25:22:25:24 | "D" : String | A.java:4:5:4:7 | this <constr(this)> [post update] [Reverse] : Box [elem] |
5453
| A.java:25:22:25:24 | "D" : String | A.java:4:9:4:16 | e : String |
5554
| A.java:25:22:25:24 | "D" : String | A.java:4:21:4:24 | this <.field> [Reverse] : Box [elem] |
5655
| A.java:25:22:25:24 | "D" : String | A.java:4:21:4:24 | this <.field> [post update] : Box [elem] |
@@ -89,7 +88,6 @@
8988
| A.java:27:16:27:18 | "E" : String | A.java:14:11:14:20 | f2(...) : new A(...) { ... } [Box b2, ... (2)] |
9089
| A.java:27:16:27:18 | "E" : String | A.java:15:16:15:16 | a : new A(...) { ... } [Box b2, ... (2)] |
9190
| A.java:27:16:27:18 | "E" : String | A.java:15:16:15:22 | get(...) : String |
92-
| A.java:27:16:27:18 | "E" : String | A.java:26:14:26:26 | new Box(...) [Reverse] : Box [elem] |
9391
| A.java:27:16:27:18 | "E" : String | A.java:27:5:27:6 | b2 [Reverse] : Box [elem] |
9492
| A.java:27:16:27:18 | "E" : String | A.java:27:5:27:6 | b2 [post update] : Box [elem] |
9593
| A.java:27:16:27:18 | "E" : String | A.java:28:11:38:5 | Box b2 : Box [elem] |

java/ql/test/library-tests/dataflow/partial/test.expected

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
edges
2-
| A.java:12:5:12:5 | b [Reverse] : Box [elem] | A.java:11:13:11:21 | new Box(...) [Reverse] : Box [elem] |
32
| A.java:12:5:12:5 | b [post update] : Box [elem] | A.java:12:5:12:5 | b [Reverse] : Box [elem] |
43
| A.java:12:5:12:5 | b [post update] : Box [elem] | A.java:13:12:13:12 | b : Box [elem] |
54
| A.java:12:14:12:18 | src(...) : Object | A.java:12:5:12:5 | b [post update] : Box [elem] |
@@ -8,7 +7,6 @@ edges
87
| A.java:17:13:17:16 | f1(...) : Box [elem] | A.java:18:8:18:8 | b : Box [elem] |
98
| A.java:18:8:18:8 | b : Box [elem] | A.java:21:11:21:15 | b : Box [elem] |
109
#select
11-
| 0 | A.java:11:13:11:21 | new Box(...) [Reverse] : Box [elem] |
1210
| 0 | A.java:12:5:12:5 | b [Reverse] : Box [elem] |
1311
| 0 | A.java:12:5:12:5 | b [post update] : Box [elem] |
1412
| 0 | A.java:12:5:12:18 | ...=... : Object |

shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll

+5-5
Original file line numberDiff line numberDiff line change
@@ -2055,8 +2055,8 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
20552055

20562056
pragma[nomagic]
20572057
private predicate fwdFlowOutCand(
2058-
DataFlowCallEx call, RetNodeEx ret, CcNoCall innercc, DataFlowCallable inner, NodeEx out,
2059-
ApApprox apa, boolean allowsFieldFlow
2058+
NormalDataFlowCall call, RetNodeEx ret, CcNoCall innercc, DataFlowCallable inner,
2059+
NodeEx out, ApApprox apa, boolean allowsFieldFlow
20602060
) {
20612061
fwdFlowIntoRet(ret, _, innercc, _, _, _, apa, _) and
20622062
inner = ret.getEnclosingCallable() and
@@ -2071,8 +2071,8 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
20712071

20722072
pragma[nomagic]
20732073
private predicate fwdFlowOutValidEdge(
2074-
DataFlowCallEx call, RetNodeEx ret, CcNoCall innercc, DataFlowCallable inner, NodeEx out,
2075-
CcNoCall outercc, ApApprox apa, boolean allowsFieldFlow
2074+
NormalDataFlowCall call, RetNodeEx ret, CcNoCall innercc, DataFlowCallable inner,
2075+
NodeEx out, CcNoCall outercc, ApApprox apa, boolean allowsFieldFlow
20762076
) {
20772077
fwdFlowOutCand(call, ret, innercc, inner, out, apa, allowsFieldFlow) and
20782078
FwdTypeFlow::typeFlowValidEdgeOut(call.projectToCall(), inner) and
@@ -2081,7 +2081,7 @@ module MakeImpl<LocationSig Location, InputSig<Location> Lang> {
20812081

20822082
pragma[inline]
20832083
private predicate fwdFlowOut(
2084-
DataFlowCallEx call, DataFlowCallable inner, NodeEx out, FlowState state,
2084+
NormalDataFlowCall call, DataFlowCallable inner, NodeEx out, FlowState state,
20852085
CcNoCall outercc, SummaryCtx summaryCtx, Typ t, Ap ap, ApApprox apa, TypOption stored
20862086
) {
20872087
exists(RetNodeEx ret, CcNoCall innercc, boolean allowsFieldFlow |

0 commit comments

Comments
 (0)