New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add query for CWE-758: Reliance on Undefined, Unspecified, or Implementation-Defined Behavior #6231
Conversation
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.
cpp/ql/src/experimental/Security/CWE/CWE-758/UndefinedOrImplementationDefinedBehavior.ql
Outdated
Show resolved
Hide resolved
cpp/ql/src/experimental/Security/CWE/CWE-758/UndefinedOrImplementationDefinedBehavior.ql
Show resolved
Hide resolved
…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:
glennrp/libpng#378
FortressOne/fteqw-code#5
arthurodriguesbatista/tiger-compiler#1
LindaBoussetila/game_persistence#1
robertdavidgraham/masscan#586