571 Commits

Author SHA1 Message Date
Robert Reif
40009d091d add multi-dimension array support to second checkScope and use it for member arrays 2011-09-11 20:42:57 -04:00
Robert Reif
0d6592dd2e use correct checkScope function in CheckBufferOverrun for single dimension member arrays 2011-09-11 19:21:13 -04:00
Robert Reif
19928e26d1 refactor to unify functionally identical code in CheckBufferOverrun::checkScope() 2011-09-11 14:00:53 -04:00
Robert Reif
547a79d4fe calculate array size for variable length structures with array at end in CheckBufferOverrun::checkStructVariable() when possible 2011-09-10 10:14:32 -04:00
Robert Reif
b0eab2587d better detection of variable sized structure in CheckBufferOverrun::checkStructVariable() 2011-09-09 08:37:24 -04:00
Robert Reif
27bfa2a346 fix some CheckBufferOverrun::checkStructVariable() flase negatives for possible variable length structs 2011-09-09 07:46:06 -04:00
Robert Reif
16924c7c7a fix (Buffer access out-of-bounds in struct variable) 2011-09-09 07:16:39 -04:00
Robert Reif
812a17f294 fix one of the TODO testcases added for (Buffer access out-of-bounds in struct variable) 2011-09-08 22:44:25 -04:00
Robert Reif
65b1a4df19 add soem test cases for (Buffer access out-of-bounds in struct variable) 2011-09-08 22:41:18 -04:00
Robert Reif
7451c5cece warn when buffer is not zero terminated after memmove 2011-09-05 15:59:41 -04:00
Robert Reif
f5d71d1ac5 warn when buffer is not zero terminated after memcpy 2011-09-05 15:41:37 -04:00
Robert Reif
3c8988e7a5 warn when buffer is not zero terminated after strncpy 2011-09-05 15:19:38 -04:00
Robert Reif
fe85b8779e fix (false negative: buffer access out of bounds) 2011-09-04 21:39:52 -04:00
Robert Reif
50688b28fd fix (false negative: buffer access out of bounds on local struct member) 2011-09-04 19:54:57 -04:00
Robert Reif
c2b76cd41f add some variable length array tests 2011-09-04 14:39:24 -04:00
Robert Reif
e782d98241 final fix for (false negative: multi dimensional arrays not well supported) 2011-09-03 21:51:00 -04:00
Daniel Marjamäki
d23c58d387 enable: break out 'performance' and 'portability' from the 'style' id. Ticket: 2011-09-03 15:30:30 +02:00
Robert Reif
d749e28dc0 another partial fix for (false negative: multi dimensional arrays not well supported) 2011-09-02 21:07:29 -04:00
Robert Reif
d85410de8c partial fix for (false negative: multi dimensional arrays not well supported) 2011-09-02 19:35:09 -04:00
Daniel Marjamäki
ef30da51bf Fixed (Cppcheck crash on specific file (truecrypt).) 2011-08-29 19:16:52 +02:00
Robert Reif
cf6d04de74 fix (Symbol database: handle multidim array with unknown dimension 'char a[][4]') 2011-08-28 11:40:55 -04:00
Robert Reif
d643397a7e better message for strncpy zero-terminated check 2011-08-28 09:06:51 -04:00
Robert Reif
8c093d0f8a refactor CheckBufferOverrun::checkScope strncpy check and change experimental to inconclusive 2011-08-27 21:18:39 -04:00
Robert Reif
c4fdb8d113 better test for symbol database bug fixed in last commit 2011-08-24 06:53:27 -04:00
Robert Reif
8c1efe9bb6 improve message for (false negative: strcpy(dst, src) where src is bigger than dst) 2011-08-21 15:18:41 -04:00
Robert Reif
67e8731a96 partial fix for (false negative: strcpy(dst, src) where src is bigger than dst) 2011-08-21 14:44:55 -04:00
Robert Reif
a30da73d3e fix (segmentation fault of cppcheck ( x[y] )) 2011-08-09 19:45:18 -04:00
Daniel Marjamäki
e2367b4149 Fixed (False positive: array out of bounds) 2011-08-08 18:22:15 +02:00
Daniel Marjamäki
999b80bbb8 Buffer overrun: Fix false negative 2011-08-07 17:54:25 +02:00
Kimmo Varis
cfcfa3f000 Use "enabled" list for the style checking.
Settings-class currently enables style checking via dedicated
boolean attribute. All other CLI's enable-options are handled
through the enable-list. This commit moves style-check enabling
to use the enable-list.

Main advantage is the consistency how options are handled/stored
in the Settings class. Which also unifies using them for the other
code. You need to enable certain type of checks? Use the
addEnabled()-method. You want to check if certain type of checks
are enabled? Use the isEnabled()-method.
2011-08-07 10:28:52 +03:00
Daniel Marjamäki
fd7e085c9d Array index out of bounds: prevent false positive when a dimension for an array is unknown 2011-08-05 13:08:48 +02:00
Daniel Marjamäki
0186fc0650 tweaked the error message somewhat for id arrayIndexThenCheck 2011-08-05 09:10:07 +02:00
Daniel Marjamäki
ceb763f57a Fixed (False negative: read array and then immediately check the index 'str[i] && i<sizeof(str)') 2011-08-04 11:15:14 +02:00
Daniel Marjamäki
3cfef6285c Fixed (False positive: Array 'arr[0]' index 0 out of bounds (array size and index are unknown)) 2011-07-20 07:57:42 +02:00
Daniel Marjamäki
7dcb68f5a4 CheckBufferOverrun: Detect overflows when buffer is allocated with alloca 2011-07-17 09:35:51 +02:00
Daniel Marjamäki
e597ad72e7 Fixed (False positive: Array index out of bounds, can't compare ints to chars) 2011-06-29 18:44:05 +02:00
Daniel Marjamäki
af7c97f972 Fixed (false positive: buffer access out of bounds when using extern variable declaration) 2011-05-07 11:34:48 +02:00
Daniel Marjamäki
e5d43d4ed2 Renamed Settings::stupid to Settings::experimental 2011-04-10 15:55:08 +02:00
Daniel Marjamäki
30ee9ba6e4 Added Settings::stupid flag that can be used to hide checking that generates false positives. 2011-04-10 13:23:45 +02:00
Daniel Marjamäki
07fe361964 Fixed (Tokenizer::setVarId : varid is wrongly given when unknown macro is used) 2011-03-13 17:52:45 +01:00
Daniel Marjamäki
bea3875386 Fixed (segmentation fault of cppcheck ( struct C {} {} x)) 2011-03-09 21:00:28 +01:00
Daniel Marjamäki
bf2362d558 Fixed (False positive: buffer access out of bounds) 2011-03-08 19:49:56 +01:00
Reijo Tomperi
7f9dc42ff1 Fix test array_index_24() to share code with environments where plain char is either signed or unsigned.
This was done, because that particular test has been already fixed a couple of times and it is still broken in some systems.
2011-02-22 21:46:12 +02:00
Daniel Marjamäki
bfe28d3b26 Fixed (False positive: Buffer access out-of-bounds for u_char, uint*_t, ...) 2011-02-20 21:24:57 +01:00
Raphael Geissert
5998ec4af9 Really fix the build failure this time 2011-02-15 14:10:56 -06:00
Daniel Marjamäki
aacb94c427 Revert "Buffer overruns: Removed TODO test case. We intentionally don't check struct/class arrays fully to avoid false positives"
This reverts commit 87cc42e6f0b0c8db37a314e5ef5be2c48cc3f4bd.
2011-02-13 22:48:26 +01:00
Daniel Marjamäki
87cf0949f2 Buffer overruns: Removed TODO test case. We intentionally don't check struct/class arrays fully to avoid false positives 2011-02-13 21:48:13 +01:00
Daniel Marjamäki
87cc42e6f0 Buffer overruns: Removed TODO test case. We intentionally don't check struct/class arrays fully to avoid false positives 2011-02-13 21:42:35 +01:00
Daniel Marjamäki
518a495334 Fixed (False positive: (error) Buffer access out-of-bounds) 2011-02-12 18:34:12 +01:00
Daniel Marjamäki
318f2e8a57 Fixed (False positive on array index when using conditional operator) 2011-02-12 11:31:10 +01:00