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

fix: range logic, set end=start if end not found #30

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

niklasad1
Copy link
Member

@niklasad1 niklasad1 commented Jan 29, 2025

The call data in an extrinsic could be empty, such as https://polkadot.subscan.io/extrinsic/24413043-3 in such a scenario, the range would be start..0 which would panic if that range is used to index in to a slice or something when start > 0

The call data in the extrinsic could be empty, such as https://polkadot.subscan.io/extrinsic/24413043-3 in such a scenario, the range would be  `start..0` which would panic if start is bigger 0.
@niklasad1 niklasad1 force-pushed the fix-wrap-around-in-call-range branch from 5c9f004 to 722392b Compare January 29, 2025 17:33
Copy link
Collaborator

@jsdw jsdw left a comment

Choose a reason for hiding this comment

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

LGTM, nice job tracking this down!

@jsdw
Copy link
Collaborator

jsdw commented Jan 30, 2025

This is the sort of thing we should cover in tests (#2)

@jsdw jsdw merged commit 1e5de29 into main Jan 30, 2025
8 checks passed
@jsdw jsdw deleted the fix-wrap-around-in-call-range branch January 30, 2025 10:45
@jsdw jsdw mentioned this pull request Jan 30, 2025
niklasad1 added a commit that referenced this pull request Jan 31, 2025
The call data in the extrinsic could be empty, such as https://polkadot.subscan.io/extrinsic/24413043-3 in such a scenario, the range would be  `start..0` which would panic if start is bigger 0.
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