dtolnay / serde-yaml

Strongly typed YAML library for Rust
Apache License 2.0
964 stars 164 forks source link

Treat YAML 1.1 style octals with sign as string, not base 10 number #228

Closed dtolnay closed 2 years ago

dtolnay commented 2 years ago

Previously we'd treat values like 0127 as correctly a string not a number, per the YAML 1.2 spec. However that check did not kick in when there was a sign: -0127 or +0127, and those would end up getting parsed as a base 10 number via u64::from_str or i64::from_str, which is not correct.