Skip to content

Commit 4913a7a

Browse files
authored
Merge branch 'main' into js/resource-exhaustion-no-buffer.from
2 parents a955bd3 + efda248 commit 4913a7a

File tree

98 files changed

+18688
-555
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+18688
-555
lines changed

config/identical-files.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,24 @@
2222
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl3.qll",
2323
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl4.qll",
2424
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl5.qll",
25+
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImplForContentDataFlow.qll",
2526
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl.qll",
2627
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl2.qll",
2728
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl3.qll",
2829
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl4.qll",
2930
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImpl.qll",
3031
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImpl2.qll",
31-
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplForLibraries.qll"
32+
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplForLibraries.qll",
33+
"swift/ql/lib/codeql/swift/dataflow/internal/DataFlowImpl.qll"
3234
],
3335
"DataFlow Java/C++/C#/Python Common": [
3436
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplCommon.qll",
3537
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplCommon.qll",
3638
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImplCommon.qll",
3739
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImplCommon.qll",
3840
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImplCommon.qll",
39-
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplCommon.qll"
41+
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplCommon.qll",
42+
"swift/ql/lib/codeql/swift/dataflow/internal/DataFlowImplCommon.qll"
4043
],
4144
"TaintTracking::Configuration Java/C++/C#/Python": [
4245
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/tainttracking1/TaintTrackingImpl.qll",
@@ -57,15 +60,17 @@
5760
"python/ql/lib/semmle/python/dataflow/new/internal/tainttracking3/TaintTrackingImpl.qll",
5861
"python/ql/lib/semmle/python/dataflow/new/internal/tainttracking4/TaintTrackingImpl.qll",
5962
"ruby/ql/lib/codeql/ruby/dataflow/internal/tainttracking1/TaintTrackingImpl.qll",
60-
"ruby/ql/lib/codeql/ruby/dataflow/internal/tainttrackingforlibraries/TaintTrackingImpl.qll"
63+
"ruby/ql/lib/codeql/ruby/dataflow/internal/tainttrackingforlibraries/TaintTrackingImpl.qll",
64+
"swift/ql/lib/codeql/swift/dataflow/internal/tainttracking1/TaintTrackingImpl.qll"
6165
],
6266
"DataFlow Java/C++/C#/Python Consistency checks": [
6367
"java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplConsistency.qll",
6468
"cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplConsistency.qll",
6569
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImplConsistency.qll",
6670
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImplConsistency.qll",
6771
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImplConsistency.qll",
68-
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplConsistency.qll"
72+
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplConsistency.qll",
73+
"swift/ql/lib/codeql/swift/dataflow/internal/DataFlowImplConsistency.qll"
6974
],
7075
"DataFlow Java/C# Flow Summaries": [
7176
"java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImpl.qll",
@@ -458,7 +463,8 @@
458463
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/basessa/SsaImplCommon.qll",
459464
"csharp/ql/lib/semmle/code/cil/internal/SsaImplCommon.qll",
460465
"ruby/ql/lib/codeql/ruby/dataflow/internal/SsaImplCommon.qll",
461-
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaImplCommon.qll"
466+
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaImplCommon.qll",
467+
"swift/ql/lib/codeql/swift/dataflow/internal/SsaImplCommon.qll"
462468
],
463469
"CryptoAlgorithms Python/JS/Ruby": [
464470
"javascript/ql/lib/semmle/javascript/security/CryptoAlgorithms.qll",
@@ -559,4 +565,4 @@
559565
"javascript/ql/src/Expressions/TypoDatabase.qll",
560566
"ql/ql/src/codeql_ql/style/TypoDatabase.qll"
561567
]
562-
}
568+
}

cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplCommon.qll

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -788,24 +788,31 @@ private module Cached {
788788
cached
789789
predicate readSet(Node node1, ContentSet c, Node node2) { readStep(node1, c, node2) }
790790

791+
cached
792+
predicate storeSet(
793+
Node node1, ContentSet c, Node node2, DataFlowType contentType, DataFlowType containerType
794+
) {
795+
storeStep(node1, c, node2) and
796+
contentType = getNodeDataFlowType(node1) and
797+
containerType = getNodeDataFlowType(node2)
798+
or
799+
exists(Node n1, Node n2 |
800+
n1 = node1.(PostUpdateNode).getPreUpdateNode() and
801+
n2 = node2.(PostUpdateNode).getPreUpdateNode()
802+
|
803+
argumentValueFlowsThrough(n2, TReadStepTypesSome(containerType, c, contentType), n1)
804+
or
805+
readSet(n2, c, n1) and
806+
contentType = getNodeDataFlowType(n1) and
807+
containerType = getNodeDataFlowType(n2)
808+
)
809+
}
810+
791811
private predicate store(
792812
Node node1, Content c, Node node2, DataFlowType contentType, DataFlowType containerType
793813
) {
794-
exists(ContentSet cs | c = cs.getAStoreContent() |
795-
storeStep(node1, cs, node2) and
796-
contentType = getNodeDataFlowType(node1) and
797-
containerType = getNodeDataFlowType(node2)
798-
or
799-
exists(Node n1, Node n2 |
800-
n1 = node1.(PostUpdateNode).getPreUpdateNode() and
801-
n2 = node2.(PostUpdateNode).getPreUpdateNode()
802-
|
803-
argumentValueFlowsThrough(n2, TReadStepTypesSome(containerType, cs, contentType), n1)
804-
or
805-
readSet(n2, cs, n1) and
806-
contentType = getNodeDataFlowType(n1) and
807-
containerType = getNodeDataFlowType(n2)
808-
)
814+
exists(ContentSet cs |
815+
c = cs.getAStoreContent() and storeSet(node1, cs, node2, contentType, containerType)
809816
)
810817
}
811818

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImplCommon.qll

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -788,24 +788,31 @@ private module Cached {
788788
cached
789789
predicate readSet(Node node1, ContentSet c, Node node2) { readStep(node1, c, node2) }
790790

791+
cached
792+
predicate storeSet(
793+
Node node1, ContentSet c, Node node2, DataFlowType contentType, DataFlowType containerType
794+
) {
795+
storeStep(node1, c, node2) and
796+
contentType = getNodeDataFlowType(node1) and
797+
containerType = getNodeDataFlowType(node2)
798+
or
799+
exists(Node n1, Node n2 |
800+
n1 = node1.(PostUpdateNode).getPreUpdateNode() and
801+
n2 = node2.(PostUpdateNode).getPreUpdateNode()
802+
|
803+
argumentValueFlowsThrough(n2, TReadStepTypesSome(containerType, c, contentType), n1)
804+
or
805+
readSet(n2, c, n1) and
806+
contentType = getNodeDataFlowType(n1) and
807+
containerType = getNodeDataFlowType(n2)
808+
)
809+
}
810+
791811
private predicate store(
792812
Node node1, Content c, Node node2, DataFlowType contentType, DataFlowType containerType
793813
) {
794-
exists(ContentSet cs | c = cs.getAStoreContent() |
795-
storeStep(node1, cs, node2) and
796-
contentType = getNodeDataFlowType(node1) and
797-
containerType = getNodeDataFlowType(node2)
798-
or
799-
exists(Node n1, Node n2 |
800-
n1 = node1.(PostUpdateNode).getPreUpdateNode() and
801-
n2 = node2.(PostUpdateNode).getPreUpdateNode()
802-
|
803-
argumentValueFlowsThrough(n2, TReadStepTypesSome(containerType, cs, contentType), n1)
804-
or
805-
readSet(n2, cs, n1) and
806-
contentType = getNodeDataFlowType(n1) and
807-
containerType = getNodeDataFlowType(n2)
808-
)
814+
exists(ContentSet cs |
815+
c = cs.getAStoreContent() and storeSet(node1, cs, node2, contentType, containerType)
809816
)
810817
}
811818

cpp/ql/src/Likely Bugs/Memory Management/PotentialBufferOverflow.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* @deprecated This query is deprecated, use
1414
* Potentially overrunning write (`cpp/overrunning-write`) and
1515
* Potentially overrunning write with float to string conversion
16-
* (`cpp/overrunning-write-with-float) instead.
16+
* (`cpp/overrunning-write-with-float`) instead.
1717
*/
1818

1919
import cpp

0 commit comments

Comments
 (0)