Commit Graph

22993 Commits

Author SHA1 Message Date
Daniel Marjamäki 9ff8adcc40 GUI: Remove message box when saving results even though there are no results, to prevent problems with autosave 2020-07-13 12:31:59 +02:00
Daniel Marjamäki 4465d033f6 Bug hunting; When passing uninitialized data to unknown function it is inconclusive if that would be a problem for the function or not 2020-07-13 11:43:11 +02:00
Daniel Marjamäki 0009b4c8af test/bug-hunting/cve.py: Add --slow argument to check slow packages 2020-07-13 11:18:51 +02:00
Paul caabe56f14 Handle FPs: mutexes being locked at different scopes 2020-07-12 21:31:53 -05:00
Ken-Patrick Lehrmann 61ccf888b3 Fix some false positives when the same expression at different places does not have the same value
Typically with
```
int F(int *f);
void F2(int *a, int *b) {
  int c = *a;
  F(a); // modifies *a
  if (b && c != *a) {}
}
```
we would get the following FP:
```
[test.cpp:3] -> [test.cpp:5]: (style) The comparison 'c != *a' is always false because 'c' and '*a' represent the same value.\n
```

I guess it boils down to isSameExpression only checking that the
expression is the same (in the above case, "*a" and "*a" are indeed the
same), but there's not real check on the values.
So the patch here is a bit hackish, and we still have false negatives in
cases with dereferenced pointers.
2020-07-11 14:13:18 +02:00
Rikard Falkeborn d8e7e9176b Fix FN with known condition and sizeof
cppcheck behaved differently if sizeof was to the left or right of the
comparison. In order to fix this, we cannot break the while loop until
all operands have been processed.
2020-07-10 23:39:16 +02:00
Daniel Marjamäki 27841d6b81 Fixed #9795 (False positive: Local lock is not ineffective, mutex is locked in thread also.) 2020-07-10 19:24:45 +02:00
Rikard Falkeborn 5fa3d5304b
Run dmake (#2705) 2020-07-10 08:20:38 +02:00
Rikard Falkeborn 1e679cc5d1 Fix #9635 (FP: Memory leak with comma operator in if-statement)
When checking for comparisons in if-statements, if there are comma
operators in the if-statement, skip until after the last comma.
2020-07-09 21:31:43 +02:00
Daniel Marjamäki 0c6aabe444
Merge pull request #2703 from rikardfalkeborn/9652-fp-function-call-cast-config
Fix #9652 (fp memleak with function call with cast)
2020-07-08 15:10:41 +02:00
Daniel Marjamäki e26f717f59
Merge pull request #2702 from rikardfalkeborn/9793-false-positive-lambda
Fix #9793 (false positive, memleak with lambda)
2020-07-08 15:09:14 +02:00
orbitcowboy 12033a33dc wxwidgets.cfg: Added support for more interfaces 2020-07-08 13:36:54 +02:00
orbitcowboy 9b98ee4be5 wxwidgets.cfg: Added missing cont attribute 2020-07-08 13:25:16 +02:00
orbitcowboy d973a5f8bc wxwidgets.cfg: Added support for more interfaces 2020-07-08 13:24:07 +02:00
Rikard Falkeborn 4996ec190e Fix #9652 (fp memleak with function call with cast)
When the first argument was (void *)(1), at the start of the second
iteration, arg was pointing to the "1", which caused problems for
nextArgument(), which saw the ")" as the next token and returned
nullptr, signalling that there are no more arguments.

Instead, save the first token in the argument, which makes
nextArgument() do the right thing.
2020-07-08 00:02:39 +02:00
Rikard Falkeborn d5345052ab Fix #9793 (false positive, memleak with lambda)
Skip scopes with lambdas (similar to how checkleakautovar does). In
order to fix this when the lambda is inside a for loop, make
hasInlineOrLambdaFunction() recursive. This should be what all existing
users want.
2020-07-07 21:51:36 +02:00
Daniel Marjamäki 6c90de0101
Merge pull request #2701 from anoymouserver/patch-1
qt.cfg: added namespace macros
2020-07-06 11:22:57 +02:00
anoy 24299544d4
qt.cfg: added namespace macros 2020-07-06 07:10:20 +02:00
orbitcowboy 5cb3aacf5a wxwidgets.cfg: Added support for more interfaces 2020-07-04 22:33:34 +02:00
Daniel Marjamäki 14df79a53f Travis: Use json.tool instead of jsonlint as there was some installation issues 2020-07-03 19:24:10 +02:00
Daniel Marjamäki 686a6c7862 Fixed compiler warning 2020-07-03 17:54:55 +02:00
Daniel Marjamäki 921997c9e9 itc.py; false negative is fixed 2020-07-03 17:50:56 +02:00
Daniel Marjamäki d606eb5ed9 Bump simplecpp 2020-07-03 11:42:58 +02:00
Daniel Marjamäki 8ab305d3c9 Revert "Bump simplecpp"
This reverts commit eec622b515.
2020-07-02 21:31:23 +02:00
Daniel Marjamäki eec622b515 Bump simplecpp 2020-07-02 18:18:30 +02:00
orbitcowboy 25055cec62 windows.cfg: Added support for SystemParametersInfo() 2020-07-02 08:31:27 +02:00
orbitcowboy cabafca5ae windows.cfg: Added some constants from WinUser.h 2020-07-01 16:14:59 +02:00
orbitcowboy 8ab02ed97a std.cfg: Improved bsearch() configuration 2020-07-01 15:06:00 +02:00
orbitcowboy 0770a6fe62 std.cfg: Added support for std::at_quick_exit() 2020-07-01 14:43:17 +02:00
orbitcowboy 27d6b9a57d std.cfg: Formatted comments, there are no functional changes [ci skip] 2020-07-01 11:12:22 +02:00
orbitcowboy 4f191e455e wxwidgets.cfg: Added support for more interfaces 2020-07-01 11:11:47 +02:00
Daniel Marjamäki d2b2bae7bf Fixed #7733 (False positive: scope of the variable can be reduced (variable is used in hidden code)) 2020-07-01 08:24:52 +02:00
Daniel Marjamäki f56a17bf3d Fixed #8858 (FP: identicalConditionAfterEarlyExit when there is #if) 2020-07-01 07:48:32 +02:00
Daniel Marjamäki ddd21a260f Fixed #6978 (False positive: unusedLabel shown for labels that are used in some preprocessor configurations) 2020-06-30 18:26:24 +02:00
Daniel Marjamäki 0583763cc6 Fixed #3088 (False positive: Dont report "struct or union member is never used" for structs with __attribute__((packed)) or #pragma pack(push)) 2020-06-30 11:00:40 +02:00
orbitcowboy 0f20506063 wxwidgets.cfg: Added support for more interfaces 2020-06-30 10:28:09 +02:00
orbitcowboy f5d3e6fad1 wxwidgets.cfg: Added support for more interfaces 2020-06-30 10:21:52 +02:00
orbitcowboy 0bd44995aa wxwidgets.cfg: Added support for more interfaces 2020-06-30 10:15:44 +02:00
Daniel Marjamäki 1567ccf97b
Merge pull request #2700 from pfultz2/afterConditionFunction
Extend scope of afterCondition until end of function
2020-06-30 08:28:08 +02:00
Paul c76c03c711 Replace noreturn with macro 2020-06-29 15:54:51 -05:00
Paul 67e06c18a9 Use the already available function scope 2020-06-29 15:36:01 -05:00
Paul a412e3e1f1 Mark syntax error functions as noreturn 2020-06-29 15:33:25 -05:00
Paul 600919f624 Remove redundant conditions 2020-06-29 15:13:06 -05:00
Daniel Marjamäki f34ff9325a Fixed testrunner 2020-06-29 21:53:14 +02:00
Daniel Marjamäki a0770f05e1 Reuse 'extractForLoopValues' in ValueFlow 2020-06-29 21:01:43 +02:00
Paul 07d8cb4f01 Extend scope of afterCondition until end of function 2020-06-29 11:55:59 -05:00
Paul edcf668ae2 Update test mesg 2020-06-29 10:15:36 -05:00
orbitcowboy 7d9220e96c wxwidgets.cfg: Added support for more interfaces 2020-06-29 15:31:03 +02:00
orbitcowboy 7c66dabce1 wxwidgets.cfg: Added support for more interfaces 2020-06-29 15:25:32 +02:00
Daniel Marjamäki a49d277e0d Fixed #6471 (FP functionConst - member function modifying member variable after cast (inconclusive)) 2020-06-29 13:09:01 +02:00