-
-
Notifications
You must be signed in to change notification settings - Fork 174
Out of bounds access in output generated by PyYAML #68
Comments
I was not able to reproduce this. Are you sure the out of bounds wasn't in your code? extern crate yaml_rust;
extern crate serde_yaml;
fn main() {
let y = r#"---
content: "Foo\
Bar""#;
println!("{}", y);
println!("{:?}", yaml_rust::YamlLoader::load_from_str(y).unwrap());
println!("{:?}", serde_yaml::from_str::<serde_yaml::Value>(y).unwrap());
} |
I'll work on writing a minimal script that reproduces it. So far I assumed it's the library because the backtrace goes through
|
That definitely looks like a bug. If you are able to reproduce it with a short self-contained example, please open a yaml-rust issue. |
For some reason the code that has the static string won't reproduce it for me, but I wrote a script that loads it from a file and it does break in the same way. Also I notice that SenseTime-Cloud committed a fix to yaml_rust that fixes an |
Yep, that was it. After updating to yaml-rust git, it's fixed. I'm still not sure why your script didn't reproduce it, so here's mine for posterity:
buggy-game.yaml:
After updating yaml-rust to master, it prints it out successfully but the serde_yaml breaks (because i guess it's pinned to yaml-rust 0.3.5). |
That looks like a different issue. Serde won't let you deserialize - let x: () = serde_yaml::from_str(&apps).unwrap();
+ let x: serde_yaml::Value = serde_yaml::from_str(&apps).unwrap(); |
In any case I still can't reproduce this even with the File read_to_string code and yaml-rust 0.3.5, so the fix in yaml-rust master may not be the issue you hit.
|
Figured it out. I'm on windows, my file has About the |
Great, thanks for confirming that it is fixed! I will need to cut a yaml-rust release when I get a chance. For me with |
Moved from #49 (comment).
Hi, I ran into the
Out of bounds access
in the wild with some output generated by PyYAML. I minimized it to a pretty simple example:Is this just a case of missing support for line continuations? Should I file a separate ticket for that?
@radix
The text was updated successfully, but these errors were encountered: