Skip to content

fix null ptr deref #1528

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

Merged
merged 1 commit into from
Jul 18, 2025
Merged

fix null ptr deref #1528

merged 1 commit into from
Jul 18, 2025

Conversation

benma
Copy link
Collaborator

@benma benma commented Jul 18, 2025

confirm_gesture_create was called with NULL as parent, so ui_util_position_right_top(parent, confirm_gesture); passed NULL, and the function derefed NULL to compute the position.

Though undefined behavior technically, 0 is a valid pointer in the BitBox02 (start of bootloader), so some bytes slightly offset from 0 were used for the positions.

None of that impacted the device behavior though as the positioning of the component was not needed in the first place. The component has a custom _render function that renders the confirm arrows in the right location without looking at component->position, so we can just remove the offendling line.

The parent param is removed as it is unused.

`confirm_gesture_create` was called with `NULL` as parent, so
`ui_util_position_right_top(parent, confirm_gesture);` passed NULL,
and the function derefed NULL to compute the position.

Though undefined behavior technically, 0 is a valid pointer in the
BitBox02 (start of bootloader), so some bytes slightly offset from 0
were used for the positions.

None of that impacted the device behavior though as the positioning of
the component was not needed in the first place. The component has a
custom _render function that renders the confirm arrows in the right
location without looking at `component->position`, so we can just
remove the offendling line.

The parent param is removed as it is unused.
@benma benma merged commit 04cf90c into BitBoxSwiss:master Jul 18, 2025
32 checks passed
@benma benma deleted the fixnull branch July 18, 2025 03:11
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