Add query for CWE-758: Reliance on Undefined, Unspecified, or Implementation-Defined Behavior#6231
Add query for CWE-758: Reliance on Undefined, Unspecified, or Implementation-Defined Behavior#6231geoffw0 merged 3 commits intogithub:mainfrom ihsinme:ihsinme-patch-277
Conversation
geoffw0
left a comment
There was a problem hiding this comment.
Hi @ihsinme, thank you for this contribution!
I've had a quick read through the code and it looks like a promising area to explore. We do have cpp/errors-when-using-bit-operations but I don't think it covers anywhere near as much stuff as your query does.
…entationDefinedBehavior.ql Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
|
This is not the first time I notice that you find the code that you have and that is similar to my suggestions, more efficiently than me. if you could give me a couple of tips as you are looking for, I would make fewer mistakes in this direction. |
|
When I'm looking for existing queries I generally just search the query directory (https://github.com/github/codeql/tree/main/cpp/ql/src) for one or two keywords I think might be appropriate. It isn't a flawless process. |
|
Here's a run of the query on a fairly large collection of LGTM projects: https://lgtm.com/query/523449955668756695/ I was worried this would be a noisy query but this turns out not to be the case, results appear quite promising. 👍 Do you want me to merge this now or wait for any other changes? |
|
if you think the request is mergeable. |
Good day.
in this query I am looking for possible undefined behavior errors in expressions.
I have identified 4 main areas:
search results in real software:
pnggroup/libpng#378
FortressOne/fteqw-code#5
arthurodriguesbatista/tiger-compiler#1
LycorisBellua/c_game_treasure-venture#1
robertdavidgraham/masscan#586