Merge pull request #358 from dtolnay/depth

Fix integer overflow in nested comment parser
This commit is contained in:
David Tolnay 2022-10-15 01:23:11 -07:00 committed by GitHub
commit 46e9bd6b7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;