Commit Graph

502 Commits

Author SHA1 Message Date
chrchr-github 13e8d5220c
Fix another c_strParam regression () 2022-08-23 20:26:36 +02:00
chrchr-github 4be7f689d7
Fix c_strParam regression ()
* Fix  New check: Not needed c_str() operation

* Comment

* Detect more instances of c_str() misuse

* Fix bad merge

* Check for data() also

* Fix

* Format

* Format

* Fix c_strParam regression
2022-08-23 15:00:27 +02:00
chrchr-github 66fca7ba91
Detect more instances of c_str() misuse ()
* Fix  New check: Not needed c_str() operation

* Comment

* Detect more instances of c_str() misuse

* Fix bad merge

* Check for data() also

* Fix

* Format

* Format
2022-08-22 14:06:10 +02:00
chrchr-github d351a97a0f
Fix FN stlcstrParam ()
* Fix  New check: Not needed c_str() operation

* Comment

* Fix error messages

* Handle more complex string expressions

* Fix  FN stlcstrParam

* Handle iterators

* Format

* Format

* Parentheses
2022-08-21 13:04:43 +02:00
chrchr-github b04bf7396f
Fix New check: Not needed c_str() operation () 2022-08-20 20:52:10 +02:00
Oliver Stöneberg 1b4141cbe5
added more missing `sstream` includes () 2022-08-19 18:23:15 +02:00
Paul Fultz II 6cb3a79a64
Fix 11147: FP invalidContainer with substr() ()
* Fix 11147: FP invalidContainer with substr()

* Format
2022-08-03 19:04:44 +02:00
chrchr-github c878285a42
Add tests for , , , () 2022-07-30 16:15:32 +02:00
chrchr-github 79f091c59a
Fix uselessCallsConstructor TODOs ()
* Fix uselessCallsConstructor TODOs

* Format
2022-07-21 22:15:16 +02:00
chrchr-github 381c38b2f5
Improve check: uselessCallsConstructor () 2022-07-12 17:40:14 +02:00
chrchr-github 47c2a01392
Fix inefficient way to remove last character from std::string ()
* Fix  inefficient way to remove last character from std::string

* Format

* Modify message, add test

* Format

* Fix another warning
2022-07-11 23:07:37 +02:00
chrchr-github f9337b725b
Fix nullptr deref ()
* Fix some FNs related to c_str()

* Format, fix FP

* Fix nullptr deref

* Fix merge
2022-07-11 22:58:08 +02:00
chrchr-github c218859418
Fix some FNs related to c_str() () 2022-07-10 11:38:01 +02:00
chrchr-github 60c1eef659
Fix FP containerOutOfBounds with std::map () 2022-06-23 20:26:47 +02:00
Paul Fultz II 9cecc8468e
Fix 10570: Improve check; condition then pointer dereference, different pointers ()
* Try to use after assign in loop

* Update valueflow forward to handle init tokens

* Fix tests

* Make test TODO

* Format

* Add tests

* Format

* Fix ubsan error

* Use simpleMatch
2022-06-16 19:26:23 +02:00
Paul Fultz II 6d3208ecb0
Fix 11062: false positive: knownEmptyContainer (regression) ()
* Fix 11062: false positive: knownEmptyContainer (regression)

* Format
2022-05-12 06:24:16 +02:00
Paul Fultz II 8d16ee946c
Fix 11027: False positive: containerOutOfBounds from condition in assert ()
* Fix 11027: False positive: containerOutOfBounds from condition in assert

* Format
2022-05-05 06:54:44 +02:00
Paul Fultz II 5afd6880c3
Fix 11028: False positive: invalidContainer ()
* Fix 11028: False positive: invalidContainer

* Format
2022-05-05 06:54:36 +02:00
Paul Fultz II 3e686103ae
Fix 10984: False positive: invalidContainer when explictly capturing vector by reference () 2022-04-30 09:36:28 +02:00
chrchr-github da1e2b22be
Add some tests ()
* Test for 

* Test for 

* Test for 

* Test for 

* Fix test case
2022-04-13 12:25:53 +02:00
Paul Fultz II 61b87bcc60
Fix 10955: False positive: containerOutOfBounds when using a const reference member () 2022-04-12 08:07:55 +02:00
Paul Fultz II 09c8cfb2ae
Fix 6624: false negative: std::vector out of bounds access not detected ()
* Fix 6624: false negative: std::vector out of bounds access not detected

* Format

* Add test for auto

* Fix tests

* Format
2022-04-07 06:47:15 +02:00
Paul Fultz II 1d92665ad2
Fix 10867: false negative: containerOutOfBounds with std::array (regression) ()
* Fix 10867: false negative: containerOutOfBounds with std::array (regression)

* Format
2022-04-06 06:25:28 +02:00
chrchr-github cfbbeb4b1b
Partial fix for FN containerOutOfBounds with std::array ()
* Partial fix for  FN containerOutOfBounds with std::array

* Format

* Format

* Optimize
2022-04-05 07:34:20 +02:00
chrchr-github 190506db40
Fix Regression: unusedStructMember ()
* Fix  Regression: unusedStructMember

* Add test for 

* simpleMatch
2022-03-13 06:27:17 +01:00
chrchr-github 7f682d544e
Partial fix for FN buffer access out of bounds: std::vector ()
* Fix  FN: stlOutOfBounds (off by one)

* Format

* Simplify

* Partial fix for  FN buffer access out of bounds: std::vector

* Undo

* Format

* Fix test case
2022-03-06 07:41:09 +01:00
chrchr-github 27baa20f38
Fix FN: stlOutOfBounds (off by one) ()
* Fix  FN: stlOutOfBounds (off by one)

* Format

* Simplify
2022-03-04 17:13:13 +01:00
Paul Fultz II 0b310b9d07
Fix 10702: FP knownConditionTrueFalse - Member variable modified ()
* Fix 10702: FP knownConditionTrueFalse - Member variable modified

* Format

* Make parameter const

* Fix FP

* Fix FP

* Update

* Format
2022-02-28 18:54:55 +01:00
Paul Fultz II dbc80787e1
Fix 10821: FN: containerOutOfBounds ()
* Fix 10821: FN: containerOutOfBounds

* Format

* Fix cppcheck warning

* Add valueflow tests

* Format

* Fix some bugs

* Format
2022-02-25 05:53:51 +01:00
Oliver Stöneberg f32583e097
removed OVERRIDE and FINAL defines and use the keywords directly () 2022-02-10 23:02:24 +01:00
chrchr-github 24e9859158
Fix FP stlcstrParam due to incorrect overload resolution ()
* Fix  FP stlcstrParam due to incorrect overload resolution

* Variable shadowing
2022-02-10 11:17:06 +01:00
Daniel Marjamäki 3989408738 Update copyright year 2022-02-05 11:45:17 +01:00
chrchr-github 17b538210d
Fix FP eraseDereference when returning iterator from loop () 2022-02-03 21:13:48 +01:00
Oliver Stöneberg 171da2e6f9
avoid dependency on transitive includes - based on include-what-you-use () 2022-01-27 19:03:20 +01:00
Paul Fultz II a7dbd288c4
Fix 10738: FP knownEmptyContainer with auto reference ()
* Fix 10738: FP knownEmptyContainer with auto reference

* Format
2022-01-21 09:56:55 +01:00
Paul Fultz II 6c2b1f093d
Another fix for 10728: Crash in CheckStl::checkDereferenceInvalidIterator2() ()
* Another fix for 10728: Crash in CheckStl::checkDereferenceInvalidIterator2()

* Format
2022-01-21 09:56:41 +01:00
Paul Fultz II 7b793af451
Fix 10728: Crash in CheckStl::checkDereferenceInvalidIterator2 ()
* Fix 10728: Crash in CheckStl::checkDereferenceInvalidIterator2

* Format
2022-01-18 14:48:02 +01:00
Paul Fultz II abb0563cef
Fix 10726: Crash in CheckExceptionSafety::checkRethrowCopy () 2022-01-16 12:35:51 +01:00
Paul Fultz II 2b6a89e30e
Fix 10716: Crash in CheckStl::checkDereferenceInvalidIterator2 ()
* Fix 10716: Crash in CheckStl::checkDereferenceInvalidIterator2

* Format
2022-01-14 23:50:33 +01:00
chrchr-github af0a585a70
Partial fix for False negative: stlOutOfBounds, cast () 2022-01-13 08:03:24 +01:00
Paul Fultz II 119ec0582a
Fix 10676: FP: Array index -1 is out of bounds. () 2022-01-04 10:21:54 +01:00
Paul Fultz II 398fa28021
Fix 10657: False positive; ValueFlow - invalid iterator () 2021-12-16 22:34:51 +01:00
Paul Fultz II 6681576707
Fix 10642: False positive: Possible dereference of an invalid iterator: v.begin()+v.size()-1 () 2021-12-15 19:31:28 +01:00
Paul Fultz II cb2738a60c
Fix 10645: FP knownEmptyContainer after conditional return () 2021-12-14 07:22:57 +01:00
orbitcowboy 97f84a368d Ticket : Added regression test. 2021-12-05 17:44:57 +01:00
Paul Fultz II f64bcac004
Fix 10429: Regression: invalidIterator () 2021-12-05 15:46:52 +01:00
Paul Fultz II a03e731930
Track lifetimes of lambdas that capture the 'this' variable () 2021-12-04 17:00:55 +01:00
Paul Fultz II 8dcea26c10
Find iterator mismatch when using temporary containers () 2021-12-04 12:55:56 +01:00
chrchr-github ca311ebcdf
ASSERT() on calls to Tokenizer::tokenize() in test code () 2021-11-29 07:34:39 +01:00
Paul Fultz II 1e327dfbd3
Fix 9836: False negative: No invalidContainer when using vector of vectors ()
* Fix 9836: False negative: No invalidContainer when using vector of vectors

* Format
2021-11-26 13:38:40 +01:00