check64bit.cpp ============== ID CWE FIT COMMENTS AssignmentAddressToInteger CWE-843 Close AssignmentIntegerToAddress CWE-843 Close checkassignif.cpp ================= ID CWE FIT COMMENTS assignIfError CWE-561 Close if detecting true or false would then be CWE 571 & 570 respectively comparisonError CWE-561 Close if detecting true of false would then be CWE 571 & 570 respectively multiCondition CWE-561 Yes else if matches previous if checkautovariables.cpp ====================== ID CWE FIT COMMENTS returnAddressOfAutoVariable CWE-562 Yes returnLocalVariable CWE-562 Yes autoVariables CWE-562 Yes returnAddressOfFunctionParameter CWE-562 Yes returnReference CWE-562 Yes returnTempReference CWE-562 Yes autovarInvalidDeallocation CWE-590 Yes Similar to mismatching new and free or malloc and delete. Does cppcheck have this check? Also should 590 be under cwe 763? returnAutocstr CWE-562 Yes returnTempPointer CWE-562 Yes checkboost.cpp ============== ID CWE FIT COMMENTS boostForeachError CWE-573 Close Might need new CCWE to better describe the API violation. In short, boost caches the end() iterator and low level ops may make it stale. Similar to mixing fopen with read/write. Does cppcheck look for this? checkbufferoverrun.cpp ====================== ID CWE FIT COMMENTS arrayIndexOutOfBounds CWE-823 Close If read or write is detected, then this could be better identified as cwe 125 & 787 respectively. Also, if stack vs heap can be detected, then 121 & 122 respectively for writes and 126 for bufferAccessOutOfBounds CWE-120 Yes This appears to check sprintf and strcpy. There are probably more cases that can be covered (gets, scanf) possibleBufferAccessOutOfBounds CWE-120 Yes Appears to check strcpy and strcat. Probably more cases could be covered possibleReadlinkBufferOverrun CWE-805 Yes strncatUsage CWE-805 Yes Appears to check strncat outOfBounds CWE-805 Appears to check readlink, snprintf. More checks on readlink should be made pointerOutOfBounds CWE-823 Close Should be more specific. See arrayIndexOutOfBounds. sizeArgumentAsChar CWE-805 Close Warning may need some more explanation to better categorize terminateStrncpy CWE-170 Yes Probably more functions fit this insecureCmdLineArgs CWE-120 Yes More functions can be added bufferNotZeroTerminated CWE-170 Yes Recheck reportInconclusiveError negativeIndex CWE-786 Close If read or write can be determined the it would be 127 & 124 respectively arrayIndexThenCheck CWE-129 Yes checkclass.cpp ============== ID CWE FIT COMMENTS noConstructor CWE-456 Close uninitVar CWE-456 Yes operatorEqVarError unusedPrivateFunction memsetClass CWE-686 Close operatorEq CWE returning wrong type or missing return operatorEqRetRefThis operatorEqToSelf virtualDestructor thisSubtraction functionConst initializerList checkexceptionsafety.cpp ======================== ID CWE FIT COMMENTS checkinternal.cpp ================= ID CWE FIT COMMENTS simplePatternError complexPatternError missingPercentCharacter checkmemoryleak.cpp =================== ID CWE FIT COMMENTS memleak CWE-401 Yes memleakOnRealloc CWE-401 Yes realloc can also leak passwords/keys if they are not scrubbed first resourceLeak CWE-404 Yes memoryLeak() could also use new type like socket. Also pipe syscall and more functions that return descriptors deallocDealloc CWE-415 Yes deallocuse CWE-416 Yes mismatchSize CWE-131 Yes mismatchAllocDealloc CWE-762 ? Need more description publicAllocationError CWE-401 Yes leakNoVarFunctionCall CWE-401 Yes checknonreentrantfunctions.cpp ============================== ID CWE FIT COMMENTS nonreentrantFunctions CWE-663 Yes checknullpointer.cpp ==================== ID CWE FIT COMMENTS nullPointer CWE-476 Yes checkobsoletefunctions.cpp ========================== ID CWE FIT COMMENTS obsoleteFunctions CWE-477 Yes checkother.cpp ============== ID CWE FIT COMMENTS incrementboolean clarifyCalculation CWE-783 Yes clarifyCondition CWE-783 Yes cstyleCast CWE-704 Yes fflushOnInputStream CWE-665 Close Maybe new CWE sizeofwithnumericparameter CWE-131 Yes sizeofwithsilentarraypointer CWE-131 Close redundantAssignInSwitch CWE-484 Close redundantStrcpyInSwitch CWE-484 Close switchCaseFallThrough CWE-484 Yes coutCerrMisusage selfAssignment assignmentInAssert incorrectLogicOperator CWE-561 Close If true, use 571 if false use 570 secondAlwaysTrueFalseWhenFirstTrue CWE-561 Close If true, use 571 if false use 570 catchExceptionByValue CWE-253 Close Maybe new CWE dangerousUsageStrtol CWE-676 Yes sprintfOverlappingData invalidscanf CWE-120 Yes wrongPrintfScanfArgs CWE-686 Yes comparisonOfBoolWithInt CWE-670 Yes duplicateBreak CWE-398 Close Doubt anything closer exists udivError CWE-195 memsetZeroBytes CWE-687 Yes variableScope passedByValue CWE-686 Yes charArrayIndex CWE-194 Yes charBitOp CWE-194 Yes constStatement strPlusChar CWE-468 Close zerodiv CWE-369 wrongmathcall CWE-687 Yes unusedScopedObject CWE-826 Close incorrectStringCompare CWE-687 Yes incorrectStringBooleanError CWE-571 Yes duplicateIf CWE-398 Close Maybe new CWE duplicateExpression CWE-398 Close Maybe new CWE staticStringCompare CWE-561 Close If true, 571. If false, then 570 stringCompare CWE-571 Yes sizeofsizeof CWE-131 Yes sizeofCalculation CWE-131 Yes assignBoolToPointer CWE-587 Close compareBoolExpressionWithInt Need out of range comparison CWE unsignedLessThanZero unsignedPositive CWE-571 Yes checkpostfixoperator.cpp ======================== ID CWE FIT COMMENTS postfixOperator checkstl.cpp ============ ID CWE FIT COMMENTS invalidIterator1 iterators eraseDereference mismatchingContainers stlOutOfBounds erase invalidIterator2 invalidPointer stlBoundries stlIfStrFind stlSize redundantIfRemove StlMissingComparison stlcstr useAutoPointerCopy useAutoPointerContainer useAutoPointerArray uselessCallsCompare uselessCallsSwap uselessCallsSubstr checkuninitvar.cpp ================== ID CWE FIT COMMENTS uninitstring CWE-170 uninitdata CWE-456 uninitvar CWE-456 checkunusedfunctions.cpp ======================== ID CWE FIT COMMENTS unusedFunction checkunusedvar.cpp ================== ID CWE FIT COMMENTS unusedVariable unusedAllocatedMemory unreadVariable unassignedVariable unusedStructMember