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

Avoid uninitialized read #240

Closed
wants to merge 1 commit into from
Closed

Conversation

dirkmueller
Copy link
Contributor

irq_info struct is initialized on stack so the members need to be initalized to avoid a crash on uninitialized pointer dereference.

Signed-off-by: Dirk Müller dirk@dmllr.de

irq_info struct is initialized on stack so the members need to
be initalized to avoid a crash on uninitialized pointer dereference.

Signed-off-by: Dirk Müller <dirk@dmllr.de>
@dirkmueller
Copy link
Contributor Author

this can be easily found by e.g using -fanalyzer:

classify.c: In function ‘check_for_irq_ban’:
classify.c:602:16: warning: use of uninitialized value ‘*irq.name’ [CWE-457] [-Wanalyzer-use-of-uninitialized-value]
  602 |         if (irq->name != NULL && strlen(irq->name) > 0 && check_for_module_ban(irq->name))
      |             ~~~^~~~~~
  ‘rebuild_irq_db’: events 1-2

@nhorman nhorman closed this in 014765d Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant