Robert Marsh
4018ed67a6
C++: respond to PR comments
2019-10-02 11:38:20 -07:00
Robert Marsh
03f72d207c
C++: use Declaration.hasGlobalOrStdName
2019-10-02 11:37:37 -07:00
Jonas Jensen
4ef5c9af62
C++: Autoformat everything
...
Some files that will change in #1736 have been spared.
./build -j4 target/jars/qlformat
find ql/cpp/ql -name "*.ql" -print0 | xargs -0 target/jars/qlformat --input
find ql/cpp/ql -name "*.qll" -print0 | xargs -0 target/jars/qlformat --input
(cd ql && git checkout 'cpp/ql/src/semmle/code/cpp/ir/implementation/**/*SSA*.qll')
buildutils-internal/scripts/pr-checks/sync-identical-files.py --latest
2019-09-09 11:25:53 +02:00
Jonas Jensen
95f53639b1
C++: Fixes to avoid confusing autoformat
...
These issues were found by Geoffrey in PR review.
2019-09-09 11:04:04 +02:00
Robert Marsh
a3290503ec
Merge pull request #1806 from jbj/localExprFlow
...
C++: Add localExprFlow and localExprTaint
2019-09-04 10:38:46 -07:00
Geoffrey White
707f95c829
CPP: Alignment.
2019-09-04 09:59:21 +01:00
Jonas Jensen
f1d7fde49d
C++: Use localExprFlow in existing queries
...
This shortens the queries a bit and ensures test coverage of the new
predicate.
2019-09-02 09:29:12 +02:00
Jonas Jensen
83e618d49e
C++: Make cpp/comparison-with-wider-type visible
...
The results from this query look good on real-world projects, so let's
make it visible by default.
2019-07-09 14:48:36 +02:00
Geoffrey White
73c7bc1db9
CPP: Generalize a little.
2019-07-04 17:27:40 +01:00
Geoffrey White
7fc31f263a
CPP: Basic fix.
2019-07-04 17:27:40 +01:00
Jonas Jensen
cf96035d8c
C++: Suspicious pointer scaling: @precision medium
...
This query is not producing good enough results to justify `@precision
high`. It's fundamentally looking for a pattern that should correlate
with memory management errors, but it doesn't look for the errors
themselves.
2019-06-06 21:08:20 -07:00
Nick Rolfe
8e7521d6b8
C++: add missing close-paragraph tag to qhelp
2019-06-04 11:27:34 +01:00
Max Schaefer
5f32e1f637
CPP: Fix name of example file in qhelp.
...
This seems to have been missed in https://github.com/Semmle/ql/pull/1315 .
2019-06-03 08:54:54 +01:00
Geoffrey White
6c267f4957
CPP: Fix qhelp.
2019-05-29 10:35:49 +01:00
Geoffrey White
76d18b42b8
CPP: Repair getQualifiedName changes from elsewhere.
2019-05-29 10:35:49 +01:00
Geoffrey White
eb880c3f9f
CPP: Reference URLs.
2019-05-29 10:35:49 +01:00
Geoffrey White
dc44d686d4
CPP: Update CWE tag.
2019-05-29 10:35:49 +01:00
Geoffrey White
34444ace8b
CPP: Update the query name and description.
2019-05-29 10:35:49 +01:00
Geoffrey White
2ae38a54af
CPP: Adjust query tags.
2019-05-29 10:35:49 +01:00
Geoffrey White
88f363d564
CPP: Update the ql, qhelp and example.
2019-05-29 10:35:48 +01:00
Geoffrey White
1f80dea375
CPP: Clone PotentiallyDangerousFunction query as DangerousUseOfGets.
2019-05-29 10:35:48 +01:00
Robert Marsh
2dd1c06409
C++: fix use of getUnspecifiedType on Node
2019-05-21 11:06:15 +01:00
Robert Marsh
e899120270
C++: replace getType().getUnspecifiedType()
2019-05-20 15:08:28 +01:00
Jonas Jensen
5e789901df
C++: Remove all uses of hasQualifiedName/1
2019-05-03 10:37:48 +02:00
Jonas Jensen
64a87a863c
C++: Remove uses of getQualifiedName
...
This removes all uses of `Declaration.getQualifiedName` that I think can
be removed without changing any behaviour. The following uses in the
LGTM default suite remain:
* `cpp/ql/src/Security/CWE/CWE-121/UnterminatedVarargsCall.ql` (in `select`).
* `cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowDispatch.qll` (needs template args).
* `cpp/ql/src/semmle/code/cpp/security/FunctionWithWrappers.qll` (used for alert messages).
2019-05-03 10:37:48 +02:00
Geoffrey White
ca6ba36d87
CPP: Unify and improve the MallocCall classes.
2019-04-18 10:30:18 +01:00
Jonas Jensen
fedd652de8
Merge remote-tracking branch 'upstream/rc/1.20' into mergeback-20190408
2019-04-08 08:39:44 +02:00
Jonas Jensen
f7dda1b3a4
Merge pull request #1213 from geoffw0/pointerscaling2
...
CPP: De-duplicate the PointerScaling queries.
2019-04-05 14:42:28 +02:00
Geoffrey White
f040755b3b
CPP: Remove unnecessary imports.
2019-04-05 11:44:50 +01:00
Geoffrey White
44d68a761d
CPP: Move 'baseType' into IncorrectPointerScalingCommon.qll.
2019-04-05 11:43:47 +01:00
Geoffrey White
695df232e3
CPP: Equalize the definitions of 'baseType'.
2019-04-05 11:28:11 +01:00
Geoffrey White
0a0bcdf939
CPP: Move some code into IncorrectPointerScalingCommon.qll.
2019-04-04 18:08:18 +01:00
Geoffrey White
7aee334baf
CPP: Update the qhelp.
2019-04-04 16:48:14 +01:00
Geoffrey White
a437e6c103
CPP: Extend coverage.
2019-04-04 16:31:02 +01:00
Jonas Jensen
842aafc888
C++: Fix new UnsafeDaclSecurityDescriptor FP
...
This query uses data flow for nullness analysis, which is always going
to be a large overapproximation. The overapproximation became too big
for one of the test cases after the recent change to make data flow go
across assignment by reference.
To make this query more conservative, it will now only report that the
`pDacl` argument can be null if there isn't also evidence that it can be
non-null.
2019-04-02 11:31:12 +02:00
Geoffrey White
743b17af50
CPP: Autoformat.
2019-03-28 15:49:36 +00:00
Geoffrey White
8c75e730e4
CPP: Widen TaintedAllocationSize.ql.
2019-03-28 15:49:36 +00:00
Jonas Jensen
76ff250593
C++: Don't repeat work in BrokenCryptoAlgorithm.ql
...
The main source of slowness in `BrokenCryptoAlgorithm.ql` was that the
regexp on function (macro) names was evaluated once per call
(invocation) instead of once per name. Factoring out separate predicates
for the problematic functions (macros) fixes this.
On https://github.com/ericniebler/range-v3 , this change reduces the run
time of the two slowest predicates from
BrokenCryptoAlgorithm::InsecureMacroSpec#class#f .... 35.1s
BrokenCryptoAlgorithm::InsecureFunctionCall#class#f . 12.8s
to
BrokenCryptoAlgorithm::getAnInsecureFunction#f . 1.2s
BrokenCryptoAlgorithm::getAnInsecureMacro#f .... 12ms
2019-03-18 12:01:37 +01:00
Max Schaefer
7f5e2630a1
Merge pull request #1032 from xiemaisi/master-for-merge
...
Merge master into rc/1.20
2019-03-04 21:23:51 +00:00
Jonas Jensen
4f9ffb38e6
C++: Set cpp/command-line-injection precision=low
...
This query is only appropriate for setuid programs. Since such programs
are at most 0.1% of all code we analyse, I would say this query has a
precision of at most 0.1%.
2019-03-04 09:51:33 +01:00
Jonas Jensen
0ed1618824
C++: Use getQualifiedName() = "gets", not hasName
...
This fixes false positives on
https://lgtm.com/projects/g/brandonpelfrey/Construct caused by a member
function named `gets` -- probably short for "get s".
2019-03-04 09:01:20 +01:00
Geoffrey White
c05df6ea4c
CPP: Add reference.
2019-02-05 17:58:30 +00:00
Geoffrey White
f73a3a6a24
CPP: Explain the danger of gets a bit more in qhelp.
2019-02-05 17:58:30 +00:00
Geoffrey White
f7e7737789
CPP: Update qhelp.
2019-02-05 17:58:30 +00:00
Geoffrey White
87a25f0cbe
CPP: Update CWE tags.
2019-02-05 17:58:30 +00:00
Geoffrey White
429f53ed74
CPP: Move the 'gets' case.
2019-02-05 17:58:30 +00:00
Geoffrey White
bbc8e7886b
CPP: Rearrange PotentiallyDangerousFunction.ql.
2019-02-05 17:58:30 +00:00
Geoffrey White
b0805f8e79
CPP: Adjust ArithmeticTainted.ql so that it can work on non-VariableAccesses.
2019-01-28 17:36:56 +00:00
Jonas Jensen
2aca40a021
Merge pull request #736 from geoffw0/macroinv2
...
CPP: Deprecate MacroInvocationExpr and MacroInvocationStmt
2019-01-25 09:02:02 +01:00
Jonas Jensen
169bbcdfa0
Merge pull request #682 from geoffw0/suspiciousaddsizeof
...
CPP: Fix false positive in SuspiciousAddWithSizeof.ql
2019-01-21 09:06:18 +01:00