-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Panic when parsing invalid comments <!-->
#604
Labels
Comments
Could you post all your code with the problem, or at least how you create reader. Probably the same reason as in #590. The mentioned line definitely not source of this bug, because error message clearly states, that start index of a indexing range is 3, but in the mentioned case it is 0. |
@Mingun Thank you for your reply! Here is a test that reproduces the problem: #[test]
fn reproduce() {
let data = b"<?xml version=\"1.0\" encoding=\"utf-8\"?><!-->";
let mut reader = Reader::from_reader(data.as_slice());
let mut buf = Vec::new();
loop {
match reader.read_event_into(&mut buf) {
Ok(Event::Eof) => break,
_ => ()
}
}
} |
Tpt
added a commit
to Tpt/quick-xml
that referenced
this issue
Jun 25, 2023
The parser was crashing because of bad slice bounds Closes tafia#604
Tpt
added a commit
to Tpt/quick-xml
that referenced
this issue
Jun 27, 2023
…not cleared before Closes tafia#604
Tpt
added a commit
to Tpt/quick-xml
that referenced
this issue
Jun 27, 2023
…not cleared before Closes tafia#604
Tpt
added a commit
to Tpt/quick-xml
that referenced
this issue
Jun 28, 2023
…not cleared before Closes tafia#604
Mingun
pushed a commit
to Tpt/quick-xml
that referenced
this issue
Jun 28, 2023
…not cleared before Closes tafia#604
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On the following input quick XML 0.28-2 panics with
'slice index starts at 3 but ends at 1', quick-xml-0.28.2/src/reader/parser.rs:104:22
I believe this error is caused by this line where the
buf.len() + i > 4
check is wrong.The text was updated successfully, but these errors were encountered: