Skip to content

ihsinme: CPP Add query for CWE-783 Operator Precedence Logic Error When Use Bool Type #340

@ihsinme

Description

@ihsinme

Query

Link to pull request with your CodeQL query:

Relevant PR: github/codeql#5325

Report

The query finds the places of erroneous use of logical operations. For example, unary minus does not work in front of a boolean type, and increment always evaluates to true. Or lack of precedence in an assignment and comparison expression. all of these situations can lead to an error in the program.
Describe the vulnerability. Provide any information you think will help GitHub assess the impact your query has on the open source community.

https://wiki.sei.cmu.edu/confluence/display/c/EXP00-C.+Use+parentheses+for+precedence+of+operation
Relevant PR: github/codeql#5325

  • Are you planning to discuss this vulnerability submission publicly? (Blog Post, social networks, etc). We would love to have you spread the word about the good work you are doing

Result(s)

Provide at least one useful result found by your query, on some revision of a real project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    All For OneSubmissions to the All for One, One for All bounty

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions