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

Add graceful error handling for less than 2 bytes packet #34

Merged
merged 3 commits into from
Dec 7, 2024

Conversation

mayurikini
Copy link
Contributor

When request for a single byte is made it panics (see below). Adding code to gracefully error out when a single byte is sent, as it doesn’t align with standard tftp protocol.

thread 'main' panicked at src/packet.rs:61:59:
range end index 2 out of range for slice of length 1
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@altugbakan altugbakan merged commit 9d0debe into altugbakan:main Dec 7, 2024
2 checks passed
@mayurikini mayurikini deleted the fix_single_byte_request branch January 10, 2025 18:56
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