Skip to content

Commit 46e9bd6

Browse files
authored
Merge pull request #358 from dtolnay/depth
Fix integer overflow in nested comment parser
2 parents 69150f4 + 5635f1b commit 46e9bd6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/parse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ fn block_comment(input: Cursor) -> PResult<&str> {
116116
return Err(Reject);
117117
}
118118

119-
let mut depth = 0;
119+
let mut depth = 0usize;
120120
let bytes = input.as_bytes();
121121
let mut i = 0;
122122
let upper = bytes.len() - 1;

0 commit comments

Comments
 (0)