92 Commits

Author SHA1 Message Date
Daniel Marjamäki
faa32fd51d Fix Cppcheck warnings and remove Travis suppressions 2016-10-29 15:50:08 +02:00
Daniel Marjamäki
9ff3e85899 Added --cppcheck-build-dir flag 2016-10-29 12:18:11 +02:00
PKEuS
9a6569fde1 Always set ErrorMessage::file0 to ensure that the source file that cppcheck is checking when an error occurs can be identified
Removed unused function and unused includes from preprocessor.h/cpp
2016-07-26 16:28:40 +02:00
Alexander Mai
0533d7bf9c Run astyle + minor refactoring 2016-02-27 16:03:50 +01:00
Roberto Martelloni
d3645d874e Mapped toomanyconfigs ,AssignmentAddressToInteger
,AssignmentIntegerToAddress ,CastIntegerToAddressAtReturn
,CastAddressToIntegerAtReturn ,assertWithSideEffect ,assignmentInAssert
,uselessAssignmentArg ,uselessAssignmentPtrArg
,comparisonOfFuncReturningBoolError
,comparisonOfTwoFuncsReturningBoolError ,comparisonOfBoolWithBoolError
,incrementboolean ,comparisonOfBoolWithInt ,compareBoolExpressionWithInt
,negativeIndex ,pointerOutOfBounds ,arrayIndexThenCheck
,possibleBufferAccessOutOfBounds ,argumentSize
,arrayIndexOutOfBoundsCond ,noConstructor ,copyCtorPointerCopying
,noCopyConstructor ,uninitMemberVar ,operatorEqVarError
,unusedPrivateFunction ,memsetClassFloat ,mallocOnClassWarning
,operatorEq ,thisSubtraction ,operatorEqRetRefThis ,operatorEqToSelf
,useInitializationList ,duplInheritedMember ,assignIfError
,comparisonError ,multiCondition ,mismatchingBitAnd
,oppositeInnerCondition ,incorrectLogicOperator ,redundantCondition
,moduloAlwaysTrueFalse to their CWEs ids.
2016-02-26 23:53:52 +00:00
Daniel Marjamäki
39a5400b7d Fix xml output for invalid chars () 2016-02-01 18:53:46 +01:00
Dmitry-Me
58541f7ffa Check string has expected format before processing it 2016-01-20 16:46:15 +03:00
Daniel Marjamäki
dc5e2d5c8d xml: output file0 whenever it is different to filename, both for included files and when #line is used. 2016-01-19 07:01:21 +01:00
Akhilesh Nema
4aa2876ca0 Fixed (GUI: error rechecking with some files) 2016-01-15 16:52:22 +01:00
Lauri Nurmi
996c9244d8 Update copyright year to 2007-2016. 2016-01-01 15:34:45 +02:00
Albert ARIBAUD (3ADEV)
b8dd71c577 Factorize toxml() into a single member function
lib/symboldatabase.cpp and lib/tokenize.cpp both
define a static toxml() function. Make it a single
static ErrorLogger::toxml() member function.
2015-12-07 18:21:01 +01:00
PKEuS
e8522c7883 Small refactorizations:
- #include cleanup
- Use std::array instead of std::vector
- Do not create a stringstream to concatenate 4 strings
- Use std::cout instead of printf
2015-11-29 10:56:44 +01:00
Daniel Marjamäki
0f9d90d2be Changed Copyrights. Removed my name. 2015-11-18 20:04:50 +01:00
Dmitry-Me
cdf1521258 Further fix search replace 2015-09-02 17:06:19 +03:00
Dmitry-Me
969b1bfbe9 Fix search-replace 2015-08-31 17:44:33 +03:00
PKEuS
1627b19dd6 Refactorizations:
- Call std::string::find() with char instead of char* where possible
- Avoid string copying
- Optimized several Token::tokAt/strAt calls
2015-08-16 10:33:51 +02:00
Dmitry-Me
c85112bdad Break list traversal once first match is found 2015-08-06 17:10:43 +03:00
PKEuS
8ed0180279 Use C++11 string.back() instead of string[string.length()-1] 2015-07-25 17:19:53 +02:00
Daniel Marjamäki
b0df668975 fix VS warning 2015-07-25 13:23:48 +02:00
Daniel Marjamäki
f3b4c1d0db Remove some useless casts, probably added to avoid false positives. 2015-07-04 13:19:21 +02:00
amai2012
5814c3b84c Fix some compiler warnings with VS
Minor refactoring on Windows SEH code.
2015-06-28 19:20:16 +02:00
Alexander Mai
712919a691 Invalid XML created - Invalid encoding of string literal. Partial fix: ensure the short message string is also processed to avoid problems with non-terminated string. 2015-06-18 21:16:25 +02:00
Alexander Mai
60f5bd97df Refactoring: missing include added, (potential) multi-threading issue fixed, expose static method to allow unit testing 2015-06-18 19:07:51 +02:00
Daniel Marjamäki
88f59ad7e8 Partial fix for (Allow that CWE is mapped for error message) 2015-04-25 17:48:11 +02:00
Thomas Jarosch
e6f042dadc Multi process check: Sanitize error messages for illegal characters
before sending them across the pipe.

The deserializer died while deserializing
a string containing a binary zero.
2015-01-17 16:12:00 +01:00
Thomas Jarosch
36bcefc39d Don't crash when the deserialization of an error message fails
Found while scanning the code of an
open source project related to onions.
2015-01-17 16:09:58 +01:00
Daniel Marjamäki
ff11ba9847 Updated copyright year to 2015 2015-01-03 12:14:58 +01:00
PKEuS
4d81945ac5 Fixed a couple of integer over/underflow issues 2014-12-09 23:28:22 +01:00
PKEuS
71264fb672 Fixed assertion failure in VS debug mode 2014-04-30 21:06:01 +02:00
Alexander Mai
73fc3d6a13 - Invalid encoding in XML output (use escape sequence string for non-printable characters) 2014-04-13 09:50:57 +02:00
PKEuS
e9411e05ba Refactorized inefficient usage of std::string and const char[]. 2014-04-02 13:56:34 +02:00
PKEuS
7e4081f7f5 Treat syntaxError and cppcheckError as InternalErrors (throw as exception, ) 2014-03-27 13:15:21 +01:00
PKEuS
357f5076db Updated tinyxml 2014-03-01 11:15:08 +01:00
Daniel Marjamäki
fd3a8a2a18 Update copyright 2014-02-15 07:45:39 +01:00
PKEuS
758d68519d Use TinyXML to write XML files 2013-08-07 16:30:55 +02:00
Alexander Mai
b7bb16ea77 Fixed (callStackToString is not available when using custom message template) 2013-07-08 06:44:25 +02:00
Daniel Marjamäki
67979f00be ErrorLogger: Make sure Token class is known 2013-05-07 18:18:15 +02:00
Daniel Marjam�ki
b9aba17b23 astyle formatting 2013-03-02 15:48:22 +01:00
Alexander Mai
0dca6e51a0 Fixed (Patch: Improve formatting for custom templates) 2013-03-02 15:16:18 +01:00
Reijo Tomperi
5d5f7085bf Updating year 2012 -> 2013 to .cpp and .h files and man page. 2013-01-01 18:29:08 +02:00
Daniel Marjamäki
6018bb4636 Fixed (unmatchedSuppression can't be suppressed) 2012-07-13 08:29:49 +02:00
Edoardo Prezioso
eacf74be8d Changed the order of some structures in order to improve, even if for a bit, their padding. 2012-05-14 20:49:03 +02:00
PKEuS
ec00824fd3 Fixed :
- Print "inconclusive" tag in cli
- Fixed inconclusive handling in checkbufferoverrun.cpp
- Merged reportInconclusiveError into reportError by adding an additional parameter "bool inconclusive" which is false per default
2012-05-06 10:37:41 -07:00
PKEuS
f105bf75a6 Refactorizations in ErrorLogger:
- Implemented constructor for ErrorLogger::ErrorMessage that takes a callstack of tokens -> replaced duplicate code in Check and Tokenizer
- Implemented strigify() for ErrorLogger::ErrorMessage::FileLocation to replace two identical implementations of it.
2012-05-06 01:17:15 -07:00
PKEuS
7de545f0fe Refactorizations:
- Added forgotten initialization of Settings::_relativePaths
- Some PCRE-Rules specific code hidden behind HAVE_RULES
- Use initialization list in ErrorLogger::ErrorMessage::ErrorMessage() and CppCheck::CppCheck
- Avoided unnecessary copies of std::strings in cppcheck.cpp
- Moved "// Alert only about unique errors"-code to make it work in debugFalsePositive mode
2012-04-06 18:16:59 +02:00
Daniel Marjamäki
4773384ff4 xml: Add attribute 'inconclusive' to the xml (format version 2) 2012-03-25 11:59:30 +02:00
PKEuS
4b52df675a Some refactorizations 2012-02-18 14:44:04 +01:00
PKEuS
2ba2a4e6ae Some refactorizations 2012-02-18 11:55:05 +01:00
Reijo Tomperi
194327048a Add InternalError and change MathLib to throw it in case of an error.
- Previously MathLib errors did not provide a filename, but after this change at least source file name should be printed
and if token is provided, also line number should be printed.
- Change also Token to use InternalError
- Modify Cppcheck-class to catch InternalError instead of Token
- Run dmake to update Makefile
2012-01-08 22:19:44 +02:00
Reijo Tomperi
8cae17fda8 Update year to 2012 2012-01-01 01:05:37 +02:00