Commit Graph

716 Commits

Author SHA1 Message Date
Oliver Stöneberg 989d276dde
removed the need for `Check` object in `CTU::getUnsafeUsage()` callback / some CheckUninitVar cleanups (#5610)
The `Check` objects were just created for that purpose so they basically
just were wrappers for the pointers passed into them and were
unnecessary.
2023-11-03 18:27:11 +01:00
Oliver Stöneberg 09785a4eb8
moved `MyFileInfo` definitions into source files (#4697) 2023-10-21 16:58:29 +02:00
Daniel Marjamäki 276f017fbe
Partial fix for #11897 (Safety: show what checks are enabled/disabled) (#5372)
Example output on stdout:
```
$ ./cppcheck m1.cpp 
Checking m1.cpp ...
Active checkers: 59/177
```
2023-08-29 12:00:52 +02:00
Oliver Stöneberg 3cf9100198
fixed #6316 (Use std::to_string() in place of MathLib::toString() ...) - deleted default implementation of `Mathlib::toString()` (#5341)
It was also used inconsistently and seemed to imply there is some
special handling which wasn't the case. It was just an alias for
`std::to_string()` for non-`double` types. So there was no need for it.

---------

Co-authored-by: Robert Reif <reif@earthlink.net>
2023-08-17 16:46:32 +02:00
chrchr-github 709fec88f9
Revert "Fix #11765 FN: minsize not checked for string literal, buffer… (#5235)
… access out of bounds not found (#5154)"

This reverts commit 9ad18f51af.
2023-07-11 22:19:01 +02:00
chrchr-github 9ad18f51af
Fix #11765 FN: minsize not checked for string literal, buffer access out of bounds not found (#5154) 2023-07-08 14:46:32 +02:00
chrchr-github bb962e2bc3
Enable and mitigate readability-else-after-return (#5175) 2023-06-20 18:43:21 +02:00
chrchr-github 7696bd1357
Fix #11225 FN constParameter with cast (#5100)
* Fix #11225 FN constParameter with cast

* Add const
2023-05-31 16:51:03 +02:00
chrchr-github e6576dd949
Fix #11708 internal error: converting '1f' to integer failed (#5066)
* Fix #11708 "internal error: converting '1f' to integer failed - not an integer" with width in printf format string

* Format
2023-05-18 23:26:56 +02:00
Oliver Stöneberg f5e51eace7
do not use string-to-integer conversions without error handling (#4906) 2023-04-08 22:29:09 +02:00
Oliver Stöneberg 5be8eee943
iwyu.yml: use a distro which has the latest `include-what-you-use` / enabled Qt mappings / cleaned up includes (#4885) 2023-04-08 16:08:47 +02:00
chrchr-github 3ccd0505cd
Enable and mitigate readability-simplify-boolean-expr (#4897) 2023-03-17 13:51:55 +01:00
Oliver Stöneberg e2f38fdaf3
removed `experimental` and `safe` from `Certainty` (#4819) 2023-03-12 14:15:29 +01:00
Oliver Stöneberg 5af6ca6637
made `Platform` a member of `Settings` instead of inheriting from it / cleanups (#4791) 2023-03-03 18:36:27 +01:00
Oliver Stöneberg b70e1d5461
avoid some unchecked pointer dereferences (#4811) 2023-03-02 22:05:41 +01:00
Oliver Stöneberg afd13ea11d
ValueFlow: some interface and namespace cleanups (#4746) 2023-01-28 10:20:47 +01:00
Daniel Marjamäki 464fbe8d53 Update copyright year 2023-01-28 10:16:34 +01:00
Oliver Stöneberg 8cc3e0b2ff
errortypes.h: use `enum class` instead of wrapping types into classes (#4693) 2023-01-08 19:31:54 +01:00
Oliver Stöneberg a09667a6d9
removed unused error messages (#4689) 2023-01-07 10:35:39 +01:00
Oliver Stöneberg 1cfe49e340
use `const_iterator` where possible (#4662) 2022-12-30 15:13:47 +01:00
Oliver Stöneberg 6fedbb4f77
add/preserve `const` in `dynamic_cast` (#4655) 2022-12-19 20:01:12 +01:00
Daniel Marjamäki c736d60642 Fix Misra C++ warning 'Limited dependence should be placed on C++ operator precedence rules in expressions.' 2022-12-17 20:45:58 +01:00
Oliver Stöneberg cff1cd9cda
applied clang-tidy `misc-const-correctness` fixes for POD types, iterators and references (#4529)
* applied `misc-const-correctness` fixes for POD types and iterators

* applied `misc-const-correctness` fixes for references
2022-10-02 07:12:40 +02:00
chrchr-github 5804cc44e7
Fix FP bufferAccessOutOfBounds (#4427)
* Fix FN with buffer size 1

* Fix FP bufferAccessOutOfBounds
2022-08-31 19:31:37 +02:00
chrchr-github 1e14e360cb
Fix #8295 FN (error) Buffer is accessed out of bounds (wcpncpy, wcsncpy) (#4412)
* Fix #8295 FN (error) Buffer is accessed out of bounds (wcpncpy, wcsncpy)

* Fix cfg, validation

* Fix validation
2022-08-29 12:24:58 +02:00
chrchr-github df704361f6
Fix FN with buffer size 1 (#4410) 2022-08-29 12:24:44 +02:00
chrchr-github 2ab8de2650
Fix #11145 FP negativeMemoryAllocationSize with possible value (#4387) 2022-08-20 07:56:31 +02:00
chrchr-github 5b4c6c1e73
Fix #11026 FP pointerOutOfBounds with strlen() (#4366) 2022-08-17 09:45:07 +02:00
chrchr-github 0d72216cca
Fix BufferOverrun TODO (#4300)
* Fix BufferOverrun TODO

* clang-tidy
2022-07-22 07:24:34 +02:00
chrchr-github 89a9e5ecc6
Fix #9944 FP: terminateStrncpy doesn't account for size check (#4252)
* Fix #9944 FP: terminateStrncpy doesn't account for size check

* Fix container size check

* Undo

* Format

* Rebuild

* Rebuild
2022-07-08 12:35:21 +02:00
PKEuS 9eb16e1002
Replaced check for pipe() buffer size by ordinary CheckBufferOverrun, provide required Library configuration option (#4183)
Merged from LCppC.
2022-06-19 12:01:55 +02:00
PKEuS 82af702c6f
LCppC backport: Restored Check: Detect negative VLA and allocation (new[]) sizes (#4187) 2022-06-11 09:55:38 +02:00
Daniel Marjamäki 3989408738 Update copyright year 2022-02-05 11:45:17 +01:00
Oliver Stöneberg 171da2e6f9
avoid dependency on transitive includes - based on include-what-you-use (#3757) 2022-01-27 19:03:20 +01:00
Paul Fultz II 7b793af451
Fix 10728: Crash in CheckStl::checkDereferenceInvalidIterator2 (#3721)
* Fix 10728: Crash in CheckStl::checkDereferenceInvalidIterator2

* Format
2022-01-18 14:48:02 +01:00
chrchr-github c05e2cc6c4
Fix #10154 False positive: objectIndex (#3666) 2022-01-04 10:37:16 +01:00
chrchr-github cea649761c
Fix FN buffer overrun with array of pointers (#3582) 2021-11-27 12:15:36 +01:00
Daniel Marjamäki f701a9361d chmod; Use 644 for source files 2021-11-17 08:25:25 +01:00
Paul Fultz II 8bff45281d
Fix 10599: regression- segmentation fault on template code (#3565) 2021-11-16 06:49:13 +01:00
Daniel Marjamäki a9a093e7cc Fixed #10367 (False positive; pointer out of bounds argv-1) 2021-09-15 08:29:10 +02:00
Paul Fultz II d4174a31ba
Fix 10414: FP 'The address of local variable 'single_value' might be accessed at non-zero index.' (regression) (#3447) 2021-09-06 07:15:46 +02:00
Daniel Marjamäki 06249c08f3 argumentSize: Clarify error message 2021-08-29 15:38:58 +02:00
Daniel Marjamäki db57efa486 CheckBufferOverrun: Reimplement CheckBufferOverrun::argumentSize check 2021-08-22 16:37:41 +02:00
Paul Fultz II e0de48bb1d
Fix 7524: ValueFlow: false path for 'x<3' (#3393) 2021-08-16 09:19:07 +02:00
Paul Fultz II 7f358b2bed
Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
Daniel Marjamäki 5f6b56ada2 buffer overrun; Fixed false negative for dynamically allocated float buffer 2021-05-22 15:39:20 +02:00
Daniel Marjamäki 0db649c075 Fixed Cppcheck self check warning; redundant check 2021-05-22 15:34:39 +02:00
Daniel Marjamäki 9a9f14bd8a Buffer overflow; Fixed FPs when array size is 1 2021-05-22 12:13:39 +02:00
Daniel Marjamäki b8314289c6 testbufferoverrun; fixed TODO test cases for pointer arithmetic overflows 2021-05-15 20:32:46 +02:00
orbitcowboy e869452240 #10244: Fixed false negative: bufferAccessOutOfBounds 2021-04-13 16:40:38 +02:00