Skip to content

Check size fix in detect_preamble#405

Merged
Enet4 merged 2 commits intoEnet4:masterfrom
DerOrfa:check_size_fix
Aug 24, 2023
Merged

Check size fix in detect_preamble#405
Enet4 merged 2 commits intoEnet4:masterfrom
DerOrfa:check_size_fix

Conversation

@DerOrfa
Copy link
Copy Markdown
Contributor

@DerOrfa DerOrfa commented Aug 23, 2023

Check for input size in detect_preamble. Fixes #404.

@DerOrfa DerOrfa changed the title Check size fix Check size fix in detect_preamble Aug 23, 2023
@Enet4 Enet4 self-requested a review August 23, 2023 17:33
@Enet4 Enet4 added A-lib Area: library C-object Crate: dicom-object labels Aug 23, 2023
Copy link
Copy Markdown
Owner

@Enet4 Enet4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, it appears to be in order. The code changes are sound and testing it in practice shows that it fixes the panic on empty and close-to-empty files.

Thank you very much @DerOrfa!

@Enet4 Enet4 merged commit abd8015 into Enet4:master Aug 24, 2023
@DerOrfa DerOrfa deleted the check_size_fix branch August 28, 2023 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-lib Area: library C-object Crate: dicom-object

Projects

None yet

Development

Successfully merging this pull request may close these issues.

detect_preamble and in extension from_reader_with_all_options doesn't check for size

2 participants