Skip to content
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

after update : Bad plist are now parsed with no error #149

Open
jrouaix opened this issue Nov 28, 2024 · 2 comments
Open

after update : Bad plist are now parsed with no error #149

jrouaix opened this issue Nov 28, 2024 · 2 comments

Comments

@jrouaix
Copy link

jrouaix commented Nov 28, 2024

hello,

just updated plist package and some errors are missing :

cargo update -p plist

    Updating crates.io index
     Locking 2 packages to latest compatible versions
    Removing base64 v0.21.7
    Removing line-wrap v0.1.1
    Updating plist v1.6.0 -> v1.7.0
    Updating quick-xml v0.31.0 -> v0.32.0 (latest: v0.37.1)
    Removing safemem v0.3.3

Then this test is now passing (should not) :

  #[test]
  fn should_fail_on_read_bad_plist_content() -> anyhow::Result<()> {
    let bad_plist = b"not a plist";
    let reader = std::io::Cursor::new(bad_plist);
    let plist_value: plist::Value = plist::from_reader(reader)?;
    assert_eq!(format!("{plist_value:?}"), "String(\"not\")");
    Ok(())
  }

Perhaps because of quick-xml ?

@ebarnard
Copy link
Owner

ebarnard commented Dec 6, 2024

I assume this is due to the newly introduced support for reading ASCII plists.

@steven-joruk Do you know if plain test is a valid ASCII plist? It doesn't look like it from a quick googling.

@ebarnard
Copy link
Owner

ebarnard commented Dec 6, 2024

I think a plist containing just one word with no whitespace e.g. valid-plist should parse, but not a valid plist should emit Ok(Event::String("not")) followed by Err(...) as the input contains unparsed data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants