Daniel Marjamäki
18aa968a7a
Astyle formatting
2019-03-23 19:03:57 +01:00
Daniel Marjamäki
5126e4b1af
Try to fix Visual Studio compiler error
2019-03-23 19:02:05 +01:00
Daniel Marjamäki
418eb43d45
Fixed #9032 (False-positive detection of reassigned value before used for pointer parameter)
2019-03-23 19:01:02 +01:00
Daniel Marjamäki
d82c792c1b
astyle formatting
2019-03-23 19:00:03 +01:00
Daniel Marjamäki
a9082c902a
Fixed #9058 (crash on invalid code in FwdAnalysis::checkRecursive)
2019-03-23 18:27:41 +01:00
Daniel Marjamäki
d6b806c592
CheckBufferOverrun: Better CTU checking when variable address is passed
2019-03-23 15:57:17 +01:00
Daniel Marjamäki
d27a4ad82e
CheckBufferOverrun: Fix ctu checking
2019-03-23 15:26:13 +01:00
Daniel Marjamäki
9653760547
CheckBufferOverrun: Improved CTU analysis for array
2019-03-23 11:20:35 +01:00
IOBYTE
40af889df0
Fixed #9053 (simplifyTypedef: wrong simplification of '(const d)' when 'd' is a array) ( #1751 )
...
* Fixed #9053 (simplifyTypedef: wrong simplification of '(const d)' when 'd' is a array)
* fix whitespace
2019-03-23 10:45:38 +01:00
Pavol Misik
7c7ee66cf9
Fix crash in TemplateSimplifier::TokenAndName::TokenAndName in case of template constexpr ( #1748 )
...
This is not propper solution. This change just eliminates crash and logs error.
https://trac.cppcheck.net/ticket/9046
2019-03-23 10:42:41 +01:00
Daniel Marjamäki
a135683d2f
Refactoring; Renamed CWE786 and CWE788
2019-03-23 08:41:20 +01:00
Daniel Marjamäki
15fc9a622d
CheckBufferOverrun: Add CTU analysis
2019-03-23 08:36:10 +01:00
Paul Fultz II
91138578cc
Fix 9052: Crash: SIGSEGV in Token::previous (this=0x0) while checking mariadb-10.0
2019-03-22 01:56:09 +01:00
Daniel Marjamäki
55433fce40
Library: added bufferSize parameters
2019-03-20 19:26:57 +01:00
Daniel Marjamäki
14528bcf25
Library: allowed values for the buffer-size attribute: malloc/calloc/strdup
2019-03-20 06:46:55 +01:00
Daniel Marjamäki
031362ae01
CheckBufferOverrun: Fix false positive
2019-03-19 21:07:08 +01:00
Daniel Marjamäki
6cbe818f1a
Fix uninitialized variable usage
2019-03-19 13:17:27 +01:00
Daniel Marjamäki
a0e58f0039
Revert "Revert "CheckBufferOverrun: Handle multidimensional arrays""
...
This reverts commit 9d1755f449
.
2019-03-19 13:16:22 +01:00
Daniel Marjamäki
9d1755f449
Revert "CheckBufferOverrun: Handle multidimensional arrays"
...
This reverts commit e98a4a6f14
.
2019-03-19 13:13:29 +01:00
Daniel Marjamäki
e98a4a6f14
CheckBufferOverrun: Handle multidimensional arrays
2019-03-19 09:29:32 +01:00
Paul Fultz II
774464eabb
Fix issue 8996: False positive duplicateCondition
...
This fixes issue 8996 by improving the alias checking by using lifetime analysis. It also extends the lifetime checker to handle constructors and initializer lists for containers and arrays.
2019-03-19 06:25:10 +01:00
Rikard Falkeborn
794f65bac1
Handle prefixed strings and characters in Token ( #1742 )
...
This makes it possible to call getStrLength() and similar functions
before the tokenizer is called.
2019-03-18 06:18:25 +01:00
Daniel Marjamäki
b53a2e5dc4
CheckBufferOverrun: restore minsize code
2019-03-17 20:34:49 +01:00
Daniel Marjamäki
03f8535c71
Better multiline warning when there is buffer overflow
2019-03-17 20:12:02 +01:00
Daniel Marjamäki
3c85d8a8ac
ValueFlow: Better info for buffer size values
2019-03-17 19:02:36 +01:00
Sebastian
19e9e42dd7
Library: Enhance minsize configuration and allow simple values. ( #1736 )
...
Some POSIX and Windows functions require buffers of at least some
specific size. This is now possible to configure via for example this
minsize configuration: `<minsize type="value" value="26"/>`.
The range for valid buffer size values is 1 to LLONG_MAX
(9223372036854775807)
2019-03-17 14:22:26 +01:00
Daniel Marjamäki
0771929518
Buffer overflow: Handling of dynamically allocated buffer
2019-03-17 13:40:56 +01:00
Daniel Marjamäki
92f4113b59
Array index: Checking array index out of bounds for dynamic buffers
2019-03-17 13:09:15 +01:00
Daniel Marjamäki
18668a52b9
Library: Added buffer-size attribute for <alloc>
2019-03-17 10:55:15 +01:00
Daniel Marjamäki
a3257349b9
astyle formatting
...
[ci skip]
2019-03-17 10:50:06 +01:00
Daniel Marjamäki
c7155a8e08
Removed '--experimental-fast' flag
2019-03-17 08:19:56 +01:00
Daniel Marjamäki
b0c92c1ac1
CheckNullPointer: Use library instead of hardcoding
2019-03-17 07:37:38 +01:00
Daniel Marjamäki
87fe5c060e
Refactoring of Null Pointer Checker
2019-03-16 21:21:30 +01:00
Daniel Marjamäki
d0c1632b51
Fix CheckBufferOverrun::array_index_12 when compiling with VS
2019-03-16 19:41:13 +01:00
Daniel Marjamäki
3dc34f1515
Disable all simplified checks
2019-03-16 09:17:50 +01:00
Daniel Marjamäki
0e88a17aca
CheckInternal: Use 'normal' checking
2019-03-16 08:51:33 +01:00
Daniel Marjamäki
f40a80c349
Use 'normal' checking instead of 'simplified'
2019-03-16 07:19:48 +01:00
Daniel Marjamäki
a2a216bbe3
SymbolDatabase: Improved handling of 'normal' non simplified token list
2019-03-15 19:00:42 +01:00
Daniel Marjamäki
92485245ce
Restore severity for 'autoVariables'
2019-03-15 15:13:11 +01:00
Sebastian
08d41ab8af
Load std.cfg before all other libraries ( #1740 )
...
- CLI: Save the libraries that should be loaded to a list and load them
after the std.cfg has been loaded.
- GUI: Load std.cfg (and windows.cfg / posix.cfg when applicable) before
setting other options and loading the other libraries.
In the project-file-dialog the std.cfg is searched first. If some
other library fails to load is is retried with first loading std.cfg.
- boost.cfg: Enable containers that depend on std containers.
2019-03-15 06:59:37 +01:00
Paul Fultz II
3615eac347
Move useStlAlgorithm to normal checking ( #1741 )
2019-03-15 06:15:56 +01:00
Daniel Marjamäki
a1ade2dd7d
Refactoring: Use range for
2019-03-14 19:57:58 +01:00
Daniel Marjamäki
56c47fc6ed
Refactoring: use continue
2019-03-14 19:53:45 +01:00
Daniel Marjamäki
3656f1ae4f
Auto variables: Fix false negatives for normal tokens
2019-03-14 13:51:35 +01:00
Daniel Marjamäki
6eeee743d2
Auto variables: Minor cleanup
2019-03-14 06:41:11 +01:00
Daniel Marjamäki
b984897526
ValueFlow: Fix sizeof for array of library type
2019-03-13 18:31:41 +01:00
Daniel Marjamäki
2ecfae0a98
CheckBufferOverrun: the bufferNotZeroTerminated did not work well, hide that for now
2019-03-13 06:45:01 +01:00
Daniel Marjamäki
81a1d744c6
CheckBufferOverrun: fix FP for array definition of static class member
2019-03-13 06:39:09 +01:00
Daniel Marjamäki
67e8b99c2c
CheckBufferOverrun: Readd a check for strncpy/memcpy/etc
2019-03-12 21:15:26 +01:00
Daniel Marjamäki
2a00667609
CheckBufferOverrun: cleanup
2019-03-12 18:58:14 +01:00