Robert Marsh
d706d7b7a4
Merge pull request #5887 from MathiasVP/fewer-rand-sources-in-uncontrolled-arithmetic
...
C++: Add more sanitizers to `cpp/uncontrolled-arithmetic`
2021-05-14 15:35:56 -07:00
Mathias Vorreiter Pedersen
2d0a56128d
C++: Prevent flow out of pointer-difference expressions.
2021-05-14 13:49:48 +02:00
Mathias Vorreiter Pedersen
c1d41b3169
C++: Add false positive result from pointer-difference expressions.
2021-05-14 13:47:23 +02:00
Mathias Vorreiter Pedersen
5031b73f35
C++: Add barrier to cpp/uncontrolled-allocation-size that blocks flow when overflow isn't possible.
2021-05-14 13:43:20 +02:00
Geoffrey White
3a83ff54e6
C++: Add support for class methods.
2021-05-13 16:02:00 +01:00
Geoffrey White
2576075b98
C++: Repair result message.
2021-05-13 15:52:28 +01:00
Geoffrey White
5d1ef49f8f
C++: Add support for enum constants.
2021-05-13 15:42:42 +01:00
Geoffrey White
e4d2c7cfc4
C++: Rewrite so that we look for additional evidence.
2021-05-13 13:19:39 +01:00
Geoffrey White
123889a671
C++: Fix 'triple DES' false positives.
2021-05-13 10:21:06 +01:00
Geoffrey White
0450caa73d
C++: Exclude array initializers.
2021-05-12 19:39:30 +01:00
Geoffrey White
52a88af6c1
C++: Exclude macro invocations in switch case expressions.
2021-05-12 19:33:18 +01:00
Geoffrey White
9404d0676d
C++: Exclude macros that don't generate anything.
2021-05-12 19:28:08 +01:00
Geoffrey White
b6d5f7c315
C++: Fix FPs caused by substring regexp.
2021-05-12 19:23:49 +01:00
Geoffrey White
109fa4d38e
C++: Add test cases for BrokenCryptoAlgorithm.ql.
2021-05-12 19:16:00 +01:00
Mathias Vorreiter Pedersen
e94dab70b5
C++: Add sanitizers to cpp/uncontrolled-arithmetic.
2021-05-12 15:44:09 +02:00
Geoffrey White
8f152b7380
Merge pull request #5877 from MathiasVP/detect-more-abs-in-overflow-library
...
C++: Detect more uses of `abs`
2021-05-12 10:02:12 +01:00
Mathias Vorreiter Pedersen
948f1d8e34
C++: Add testcase with INTMAX_MIN.
2021-05-11 19:43:21 +02:00
Geoffrey White
d7e560c611
Merge pull request #5767 from ihsinme/ihsinme-patch-268
...
CPP: Add query for CWE-1126: Declaration of Variable with Unnecessarily Wide Scope
2021-05-11 15:24:25 +01:00
Mathias Vorreiter Pedersen
48e783184c
C++: Fix false positive by recognizing more absolute value functions in Overflow.qll
2021-05-11 14:30:28 +02:00
Mathias Vorreiter Pedersen
24d8abd2c2
C++: Add false positive testcase when an absolute value is used in comparison.
2021-05-11 14:27:53 +02:00
AlexDenisov
2905bb8b9a
Merge pull request #5861 from AlexDenisov/alexdenisov/adjust-user-defined-literals-test
...
C++: Adjust user-defined literals test' expectations
2021-05-11 09:31:54 +02:00
Mathias Vorreiter Pedersen
5016c6436a
Merge pull request #5859 from MathiasVP/fix-fp-in-comparison-with-wider-type
...
C++: Fix false positive in `cpp/comparison-with-wider-type`
2021-05-10 17:58:31 +02:00
Mathias Vorreiter Pedersen
51d04cb5b3
C++: Correct test annotation.
2021-05-10 15:30:35 +02:00
Mathias Vorreiter Pedersen
c0b65314be
C++: Fix false positive by restricting _both_ the old (unconverted) expression _and_ all of the conversions.
2021-05-10 15:18:42 +02:00
Mathias Vorreiter Pedersen
c7cd75437f
C++: Add testcase demonstrating false positive from conversions.
2021-05-10 14:58:33 +02:00
ihsinme
9e5a38debd
Update DeclarationOfVariableWithUnnecessarilyWideScope.expected
2021-05-10 14:17:40 +03:00
ihsinme
d3c6093f37
Update test.c
2021-05-10 14:16:38 +03:00
Alex Denisov
dcdd54593e
C++: Adjust user-defined literals test' expectations
2021-05-10 13:03:40 +02:00
Mathias Vorreiter Pedersen
c91ed80e6c
C++: Fix false positive by computing range of the converted expression.
2021-05-10 10:12:43 +02:00
Mathias Vorreiter Pedersen
7ac7830973
C++: Add testcase with false positive involving a conversion on the large-expression side of the comparison.
2021-05-10 10:11:31 +02:00
Dave Bartolomeo
773e5f2e2e
Merge remote-tracking branch 'upstream/main' into side-effects
2021-05-07 16:50:48 -04:00
Dave Bartolomeo
187e136ecc
C++: Generate IR side effects for smart pointer indirections
...
When inserting side effect instructions for argument indirections, we now insert side effects for smart pointers as we would for raw pointers. The address operand of the side effect instruction is the smart pointer object, which is a bit odd. However, I'd like to think through the design of a more principled solution before doing additional work.
A few new tests are added to the existing IR tests. In addition, the IR tests now `#include` some of the shared STL headers. I've disabled IR dumps for functions from those headers, since they only get in the way of the test cases we intended.
2021-05-07 16:50:03 -04:00
Geoffrey White
65ac5b862d
Merge pull request #5847 from MathiasVP/improve-wrong-in-detecting-and-handling-memory-allocation-errors
...
Improve wrong in detecting and handling memory allocation errors
2021-05-07 17:39:04 +01:00
Geoffrey White
75edcf0b4f
Merge branch 'main' into unsigneddiff2
2021-05-07 16:35:16 +01:00
Mathias Vorreiter Pedersen
fc7d9c2c09
C++: Fix missing result by properly specifying that the function with unknown code actually didn't throw an exception.
2021-05-07 12:34:38 +02:00
Mathias Vorreiter Pedersen
90e8368258
C++: Properly handle conversions in convertedExprMayThrow. This recursive implementation idea is stolen from convertedExprMightOverflow in SimpleRangeAnalysis.
2021-05-07 12:31:43 +02:00
Mathias Vorreiter Pedersen
7adb7b67f2
C++: Add false positive testcase involving conversions.
2021-05-07 12:19:19 +02:00
Mathias Vorreiter Pedersen
88e6cbaacd
C++: Include Assignments in exprMayThrow and accept test changes.
2021-05-07 11:49:25 +02:00
Mathias Vorreiter Pedersen
80d41d9fe5
C++: Add false positive testcase involving assignments.
2021-05-07 11:48:09 +02:00
Mathias Vorreiter Pedersen
5437bd7a41
C++: Fix annotation.
2021-05-06 17:57:57 +02:00
Robert Marsh
230f4bcae8
C++: accept test changes from IR sharing
2021-05-06 08:14:45 -07:00
Robert Marsh
1f69b31239
C++: test changes in annotate_sinks_only
2021-05-06 08:14:43 -07:00
Robert Marsh
195b811422
C++: handle phi operands from unreachable blocks
2021-05-06 08:14:42 -07:00
Robert Marsh
6600436dd9
C++: handle degenerate phi nodes
2021-05-06 08:14:41 -07:00
Robert Marsh
7930c4ab19
C++: tests for phi nodes after unreachable blocks
2021-05-06 08:14:41 -07:00
Robert Marsh
86b1d032ae
C++: accept test regressions
2021-05-06 08:14:38 -07:00
Robert Marsh
f9e0ba17e0
C++: remove points-to expectations for reused SSA
2021-05-06 08:14:37 -07:00
Robert Marsh
1c72ea97a7
C++: accept phi node reorderings in IR tests
2021-05-06 08:14:37 -07:00
Robert Marsh
a9d7990596
C++: make unaliased_ssa IR stage sound
2021-05-06 08:14:33 -07:00
Robert Marsh
d95ef89cee
C++: add test for IR alias analysis soundness
2021-05-06 08:14:32 -07:00