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

RULE-8-13: Consider assignment to struct fields as writing to pointer to object #762

Closed
lcartey opened this issue Oct 21, 2024 · 0 comments · Fixed by #765
Closed

RULE-8-13: Consider assignment to struct fields as writing to pointer to object #762

lcartey opened this issue Oct 21, 2024 · 0 comments · Fixed by #765
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

Comments

@lcartey
Copy link
Collaborator

lcartey commented Oct 21, 2024

Affected rules

  • RULE-8-13

Description

Writing to a struct field should be considered writing to the object itself.

Example

struct S {
  int* x;
};

void example_function(struct S s) { // COMPLIANT - can't be const, written to in struct call
  s->x = 1;
}
@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 labels Oct 21, 2024
@lcartey lcartey self-assigned this Oct 21, 2024
@lcartey lcartey moved this from Reported to Ready for review in Coding Standards Public Development Board Oct 21, 2024
@lcartey lcartey linked a pull request Oct 23, 2024 that will close this issue
30 tasks
@lcartey lcartey closed this as completed Oct 23, 2024
@github-project-automation github-project-automation bot moved this from Ready for review to Done in Coding Standards Public Development Board Oct 23, 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
Projects
Development

Successfully merging a pull request may close this issue.

1 participant