Skip to content

Add boundary checks in gen_associated_data_from_range() #788

@arrayka

Description

@arrayka

Since start/end are user-provided (via the CLI wrapper), this function should defensively validate end >= start and avoid unchecked u32 arithmetic (currently end - start + 1 will overflow/panic when end < start, and can also overflow when end == u32::MAX && start == 0). Consider returning an error on invalid ranges and computing the count with checked arithmetic.

Originally posted by @Copilot in #763

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status

No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions