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

abbreviate_public_key Function Panics on Short Keys Due to Underflow #1176

Closed
moalshak opened this issue Dec 18, 2024 · 0 comments · Fixed by #1171
Closed

abbreviate_public_key Function Panics on Short Keys Due to Underflow #1176

moalshak opened this issue Dec 18, 2024 · 0 comments · Fixed by #1171
Labels

Comments

@moalshak
Copy link
Contributor

The abbreviate_public_key function in warpgate-protocol-http/src/api/credentials.rs panics when handling keys shorter than the defined abbreviation length (10 characters). This happens because the subtraction used to calculate the starting index for the last l characters (k.len() - l) results in an underflow for short keys.

thread 'main' panicked at 'attempt to subtract with overflow', src/api/credentials.rs:90:12
@moalshak moalshak changed the title Issue Title: abbreviate_public_key Function Panics on Short Keys Due to Underflow abbreviate_public_key Function Panics on Short Keys Due to Underflow Dec 18, 2024
moalshak added a commit to moalshak/warpgate that referenced this issue Dec 18, 2024
also fix db migration
also fix warp-tech#1176
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants