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

Ensure that furi_record_create is passed a non-NULL data pointer #4078

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

dcoles
Copy link
Contributor

@dcoles dcoles commented Jan 24, 2025

It's currently possible to use furi_record_create to create and initialize a FuriRecordData pointing to NULL.

This means its potentially possible for furi_record_open to return a NULL pointer which besides not being particularly useful means the Rust wrapper for Record can't assume that the returned record is always a non-NULL value.

If by chance this is the intended behaviour, then we can just have the Rust wrapper do a furi_check itself, but it seems like it would be better to eliminate this potential corner-case at the source.

What's new

  • furi_record_create now checks that data is a non-NULL pointer

Verification

  • Calling furi_record_create with a NULL data pointer should trigger a furi_check system crash

Checklist (For Reviewer)

  • PR has description of feature/bug or link to Confluence/Jira task
  • Description contains actions to verify feature/bugfix
  • I've built this code, uploaded it to the device and verified feature/bugfix

It's currently possible to use `furi_record_create` to create and initialize a `FuriRecordData` pointing to NULL.

This means its potentially possible for `furi_record_open` to return a NULL pointer which besides not being particularly useful means the Rust wrapper for `Record` can't assume that the returned record is always a non-NULL value.

If by chance this is the intended behaviour, then we can just have the Rust wrapper do a `furi_check` itself, but it seems like it would be better to eliminate this potential corner-case at the source.
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.

1 participant