-
Notifications
You must be signed in to change notification settings - Fork 241
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
Deserialization of a doctype with very long content fails #533
Comments
This even happens if there's anything after the
Can we fix this? I would be up to do this since |
Feel free to submit a PR. Actually, the #590 seems a duplicate of this bug, so you can start from my findings there. |
Looks a lot like a trimming problem. |
My problem might be off-topic, but #603 got the same idea. |
An even more minimal code to reproduce the error: use serde::Deserialize;
use std::io::BufReader;
#[derive(Deserialize)]
struct X {}
fn main() {
let xml = "<!DOCTYPE X [<!-- -->]><X></X>";
let reader = BufReader::with_capacity(20, xml.as_bytes());
let _: X = quick_xml::de::from_reader(reader).unwrap();
} |
quick_xml::de::from_reader()
parsing fails if the XML contains a doctype with content larger than the internalBufRead
capacity.For instance
Here is a minimal code to reproduce this issue. It fails with an
ExpectedStart
error.Cargo.toml
contentBufReader::with_capacity()
to increase the buffer, even of 1 byte, there is no error.BufRead
implementations don't have this issue (checked with&[u8]
andstdin
).!
from a!ENTITY
tag.serde-xml-rs
, even for larger comments.The text was updated successfully, but these errors were encountered: