Skip to content

Commit 774efb5

Browse files
committed
Merge branch 'main' into destructors-for-unconditional-unnamed
2 parents 0b7070f + b8b8e2b commit 774efb5

8 files changed

Lines changed: 14326 additions & 14115 deletions

File tree

cpp/ql/test/library-tests/ir/ir/PrintAST.expected

Lines changed: 4189 additions & 4141 deletions
Large diffs are not rendered by default.

cpp/ql/test/library-tests/ir/ir/aliased_ir.expected

Lines changed: 3663 additions & 3622 deletions
Large diffs are not rendered by default.

cpp/ql/test/library-tests/ir/ir/ir.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1933,6 +1933,20 @@ namespace missing_declaration_entries {
19331933
Bar2<int> b;
19341934
b.two_missing_variable_declaration_entries();
19351935
}
1936+
1937+
template<typename T> struct Bar3 {
1938+
1939+
int two_more_missing_variable_declaration_entries() {
1940+
extern int g;
1941+
int z(float);
1942+
return g;
1943+
}
1944+
};
1945+
1946+
void test3() {
1947+
Bar3<int> b;
1948+
b.two_more_missing_variable_declaration_entries();
1949+
}
19361950
}
19371951

19381952
template<typename T> T global_template = 42;

cpp/ql/test/library-tests/ir/ir/operand_locations.expected

Lines changed: 3242 additions & 3213 deletions
Large diffs are not rendered by default.

cpp/ql/test/library-tests/ir/ir/raw_ir.expected

Lines changed: 3175 additions & 3138 deletions
Large diffs are not rendered by default.

javascript/ql/lib/semmle/javascript/dataflow/internal/CallGraphs.qll

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,20 @@ module CallGraph {
279279
StepSummary::step(getAnAllocationSiteRef(node), result, objectWithMethodsStep())
280280
}
281281

282+
/**
283+
* Holds if `function` flows to a property of `host` via non-local data flow.
284+
*/
285+
pragma[nomagic]
286+
private predicate complexMethodInstallation(
287+
DataFlow::SourceNode host, DataFlow::FunctionNode function
288+
) {
289+
not function = getAMethodOnObject(_) and
290+
exists(DataFlow::TypeTracker t |
291+
getAFunctionReference(function, 0, t) = host.getAPropertySource() and
292+
t.start() // require call bit to be false
293+
)
294+
}
295+
282296
/**
283297
* Holds if `pred` is assumed to flow to `succ` because a method is stored on an object that is assumed
284298
* to be the receiver of calls to that method.
@@ -291,9 +305,18 @@ module CallGraph {
291305
*/
292306
cached
293307
predicate impliedReceiverStep(DataFlow::SourceNode pred, DataFlow::SourceNode succ) {
308+
// To avoid double-recursion, we handle either complex flow for the host object, or for the function, but not both.
294309
exists(DataFlow::SourceNode host |
310+
// Complex flow for the host object
295311
pred = getAnAllocationSiteRef(host) and
296312
succ = getAMethodOnObject(host).getReceiver()
313+
or
314+
// Complex flow for the function
315+
exists(DataFlow::FunctionNode function |
316+
complexMethodInstallation(host, function) and
317+
pred = host and
318+
succ = function.getReceiver()
319+
)
297320
)
298321
}
299322
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import 'dummy';
2+
3+
function fooFactoryFactory() {
4+
return function fooFactory() {
5+
return function foo() {
6+
/** calls:F.member */
7+
this.member();
8+
}
9+
}
10+
}
11+
12+
function F() {
13+
this.foo = fooFactoryFactory()();
14+
}
15+
16+
/** name:F.member */
17+
F.prototype.member = function() {
18+
return 42;
19+
};

ruby/ql/src/queries/security/cwe-116/IncompleteMultiCharacterSanitization.qhelp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ end
9090
Another potential fix is to use the popular <code>sanitize</code> gem.
9191
It keeps most of the safe HTML tags while removing all unsafe tags and attributes.
9292
</p>
93-
<sample language="javascript">
93+
<sample language="ruby">
9494
require 'sanitize'
9595

9696
def sanitize_html(input)

0 commit comments

Comments
 (0)