Skip to content

Commit

Permalink
Merge pull request #358 from dtolnay/depth
Browse files Browse the repository at this point in the history
Fix integer overflow in nested comment parser
  • Loading branch information
dtolnay committed Oct 15, 2022
2 parents 69150f4 + 5635f1b commit 46e9bd6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parse.rs
Expand Up @@ -116,7 +116,7 @@ fn block_comment(input: Cursor) -> PResult<&str> {
return Err(Reject);
}

let mut depth = 0;
let mut depth = 0usize;
let bytes = input.as_bytes();
let mut i = 0;
let upper = bytes.len() - 1;
Expand Down

0 comments on commit 46e9bd6

Please sign in to comment.