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

Abandon magic check with degenerate range #187

Merged
merged 1 commit into from
Oct 2, 2024
Merged

Conversation

hcs64
Copy link
Contributor

@hcs64 hcs64 commented Sep 22, 2024

When track 1 is entirely zero, byte_offset_by_magic() can be called with lba_end (the end of track 1) less than lba_start (the first non-zero byte). This leaves an overflowed value in sectors_to_check, likely leading to OOM or another overflow in the allocation of data. This patch abandons the check early if the range is degenerate.

@hcs64
Copy link
Contributor Author

hcs64 commented Sep 22, 2024

This became easier to hit when the VideoNow checks were added.

@superg
Copy link
Owner

superg commented Sep 29, 2024

Makes sense, I'll approve but please fix formatting.

Protects against crashing if track 1 is all zero
@superg superg merged commit 50d7c2f into superg:main Oct 2, 2024
6 checks passed
@hcs64 hcs64 deleted the zero-track-1 branch October 20, 2024 20:36
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.

2 participants