Skip to content

Commit

Permalink
no overflow panic
Browse files Browse the repository at this point in the history
  • Loading branch information
robertbastian committed Jan 20, 2022
1 parent 00fbeb2 commit 119c162
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions provider/core/src/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,13 @@ impl ResourceKey {
let path = path.as_bytes();

// Start and end of the untagged part
if path.len() < leading_tag!().len() + trailing_tag!().len() {
return Err(());
}
let start = leading_tag!().len();
let end = path.len() - trailing_tag!().len();

// Check tags
if start > end {
return Err(());
}
let mut i = 0;
while i < leading_tag!().len() {
if path[i] != leading_tag!().as_bytes()[i] {
Expand Down

0 comments on commit 119c162

Please sign in to comment.