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 cb3a9af commit d763f50
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 @@ -129,13 +129,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 d763f50

Please sign in to comment.