Skip to content

Don't try to decode options when the packet is completely empty (reported by @kit-ty-kate)#66

Open
dinosaure wants to merge 1 commit intorobur-coop:mainfrom
dinosaure:fix-when-empty-packets
Open

Don't try to decode options when the packet is completely empty (reported by @kit-ty-kate)#66
dinosaure wants to merge 1 commit intorobur-coop:mainfrom
dinosaure:fix-when-empty-packets

Conversation

@dinosaure
Copy link
Contributor

@kit-ty-kate reported a crash which comes from utcp. This is the trace:

console 2026-01-26T13:34:22-00:00: Fatal error: exception Invalid_argument("Cstruct.sub: [34,20](1514) off=20 len=-20")
console 2026-01-26T13:34:22-00:00: Raised at Stdlib.invalid_arg in file "[stdlib.ml](http://stdlib.ml/)", line 30, characters 20-45
console 2026-01-26T13:34:22-00:00: Called from Utcp__Segment.decode in file "duniverse/utcp/src/segment.ml", line 664, characters 20-73

From what I understand, we received an completely empty packet (no data, no options). This PR add a just a guard to ensure that we can Cstruct.sub. Otherwise, we returns an empty list of options.

@dinosaure dinosaure force-pushed the fix-when-empty-packets branch from 1f71f2a to 1bdaec8 Compare February 12, 2026 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant