Skip to content

CWE mapping of useAutoPointerMalloc, uselessCallsCompare, uselessCallsSwap, uselessCallsSubstr, uselessCallsEmpty, uselessCallsRemove, derefInvalidIterator, reademptycontainer, multiplySizeof, divideSizeof, stringLiteralWrite, incorrectStringCompare, literalWithCharPtrCompare, charLiteralWithCharPtrCompare, incorrectStringBooleanError, staticStringCompare, stringCompare, signConversion, truncLongCastAssignment, truncLongCastReturn, unusedFunction, unusedVariable, unusedAllocatedMemory, unreadVariable, unassignedVariable, unusedStructMember, postfixOperator, va_start_wrongParameter#824

Merged
PKEuS merged 1 commit into
cppcheck-opensource:masterfrom
boos:cwe-mapping-13
Sep 2, 2016

Conversation

@boos

@boos boos commented Aug 26, 2016

Copy link
Copy Markdown
Contributor

CWE mapping of useAutoPointerMalloc, uselessCallsCompare, uselessCallsSwap, uselessCallsSubstr, uselessCallsEmpty, uselessCallsRemove, derefInvalidIterator, reademptycontainer, multiplySizeof, divideSizeof, stringLiteralWrite, incorrectStringCompare, literalWithCharPtrCompare, charLiteralWithCharPtrCompare, incorrectStringBooleanError, staticStringCompare, stringCompare, signConversion, truncLongCastAssignment, truncLongCastReturn, unusedFunction, unusedVariable, unusedAllocatedMemory, unreadVariable, unassignedVariable, unusedStructMember, postfixOperator, va_start_wrongParameter

This is the last commit to finishing the mapping. I'll go ahead and claim CWE compatibility with the MITRE. Please confirm I can. Please also give me the lead developer email so I can CC him while asking for the compatibility claim.

Someone with access to the continuous integration system can modify the task and automate the following task:

  1. ./cppcheck --errorlist --xml-version=2 > errorlistInAFileSomeWhere.xml
  2. ./tools/listErrorsWithoutCWE.py -F errorlist.xml
  3. pipe the output and send me automatically the output by email at my private email ?

That will help me maintain updated the CWE mapping for new errors without have to waint for a new release each time.

@amai2012

Copy link
Copy Markdown
Collaborator

I think the additions to travis should be within https://github.com/danmar/cppcheck/blob/master/.travis.yml
One could consider a missing CWE as a build failure, but maybe that is a bit too strong.

@boos

boos commented Aug 26, 2016

Copy link
Copy Markdown
Contributor Author

I'm not very familiar with Travis, I need some guidance about it.

I think it is too strong, a lot of people does not even know what CWE is and as a consequence that will increase the necessary effort to contribute to the development of the toll.

Now that the full mapping is complete it is not going to be a big effort for me to keep it updated. When new errors are going to be detected I should be able to do promptly map all new errors within three days maximum a week.

Comment thread lib/checkstl.cpp Outdated
// CWE IDs used:
static const struct CWE CWE398(398U); // Indicator of Poor Code Quality
static const struct CWE CWE597(597U); // Use of Wrong Operator in String Comparison
static const struct CWE CWE628(628U); // Function Call with Incorrectly Specified Arguments

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you try to use same formatting as surrounding code? look at the comments.

@danmar

danmar commented Aug 27, 2016

Copy link
Copy Markdown
Collaborator

It would be nice if you start running astyle on every pull request.. Version 2.05.1. use the "runastyle" scripts in the cppcheck repo.

@danmar

danmar commented Aug 27, 2016

Copy link
Copy Markdown
Collaborator

Now that the full mapping is complete it is not going to be a big effort for me to keep it updated. When new errors are going to be detected I should be able to do promptly map all new errors within three days maximum a week.

Thanks that is highly appreciated.

@boos

boos commented Aug 27, 2016

Copy link
Copy Markdown
Contributor Author

In regards to CWE mapping, you are welcome. I'm happy to help. It's my first contribution in FOSS space indeed bear with me in advance if I do something wrong.
In regards to astyle, should I already run astyle on the modified files?
in regards to CWE mapping compatibility process, do you want to be in CC during the process? If you want to be in CC, would you mind to send me an email through linkedIn containing your email?

@danmar

danmar commented Aug 27, 2016

Copy link
Copy Markdown
Collaborator

In regards to astyle, should I already run astyle on the modified files?

yes please it's possible somehow to update this pull request.

@amai2012

Copy link
Copy Markdown
Collaborator

yes please it's possible somehow to update this pull request.
mislav/hub#198 might give an idea.

If that is causing too much inconvenience maybe we should accept the PR and run astyle later on. It's the last one to finish CWE mapping, would be nice to get it done soon.

@PKEuS

PKEuS commented Aug 31, 2016

Copy link
Copy Markdown
Contributor

If that is causing too much inconvenience maybe we should accept the PR and run astyle later on. It's the last one to finish CWE mapping, would be nice to get it done soon.

It is easy to update a pull request. Commit the changes (amend to previous commit) and force-push to the branch.

@boos

boos commented Aug 31, 2016

Copy link
Copy Markdown
Contributor Author

I may be able to do it tomorrow. On a side note I already received the
MITRE's form to claim CWE compatibility but I haven't yet assessed it.

On 31 August 2016 at 13:30, PKEuS notifications@github.com wrote:

If that is causing too much inconvenience maybe we should accept the PR
and run astyle later on. It's the last one to finish CWE mapping, would be
nice to get it done soon.

It is easy to update a pull request. Commit the changes (amend to previous
commit) and force-push to the branch.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#824 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAgYnuyBSycPBVMYS-V3qAnK0kj3mNw3ks5qlXPMgaJpZM4JuAtm
.

Roberto Martelloni
boos @ http://boos.core-dumped.info

…sSwap, uselessCallsSubstr, uselessCallsEmpty, uselessCallsRemove, derefInvalidIterator, reademptycontainer, multiplySizeof, divideSizeof, stringLiteralWrite, incorrectStringCompare, literalWithCharPtrCompare, charLiteralWithCharPtrCompare, incorrectStringBooleanError, staticStringCompare, stringCompare, signConversion, truncLongCastAssignment, truncLongCastReturn, unusedFunction, unusedVariable, unusedAllocatedMemory, unreadVariable, unassignedVariable, unusedStructMember, postfixOperator, va_start_wrongParameter
@boos

boos commented Sep 2, 2016

Copy link
Copy Markdown
Contributor Author

I've ran runastyle; commit; git rebase -i HEAD~2 and squashed the commit and then git push --force.
Is now ok?

@PKEuS PKEuS merged commit 28f1222 into cppcheck-opensource:master Sep 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants