Skip to content
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

A4-7-1: Exclude pointer increment/decrement #379

Closed
lcartey opened this issue Oct 3, 2023 · 1 comment · Fixed by #490
Closed

A4-7-1: Exclude pointer increment/decrement #379

lcartey opened this issue Oct 3, 2023 · 1 comment · Fixed by #490
Assignees
Labels
Difficulty-Low A false positive or false negative report which is expected to take <1 day effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-High user-report Issue reported by an end user of CodeQL Coding Standards

Comments

@lcartey
Copy link
Collaborator

lcartey commented Oct 3, 2023

Affected rules

  • A4-7-1

Description

This query is reporting ++ and -- on pointers, however the rule is restricted to data loss on integer operations.

In addition, the message currently says:

Binary expression ...++... may overflow.

Which is incorrect because we can also report unary expressions.

Example

pointer++; // Should be ignored
@lcartey lcartey added Difficulty-Low A false positive or false negative report which is expected to take <1 day effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-High user-report Issue reported by an end user of CodeQL Coding Standards labels Oct 3, 2023
@lcartey lcartey self-assigned this Jan 14, 2024
@lcartey
Copy link
Collaborator Author

lcartey commented Jan 17, 2024

The error message aspect of this should be addressed by this issue instead:
#491

@lcartey lcartey changed the title A4-7-1: Exclude pointer increment/decrement, fix message A4-7-1: Exclude pointer increment/decrement Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty-Low A false positive or false negative report which is expected to take <1 day effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-High user-report Issue reported by an end user of CodeQL Coding Standards
Projects
Development

Successfully merging a pull request may close this issue.

1 participant