{"action":"created","issue":{"url":"https://api.github.com/repos/ebarnard/rust-plist/issues/20","repository_url":"https://api.github.com/repos/ebarnard/rust-plist","labels_url":"https://api.github.com/repos/ebarnard/rust-plist/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/ebarnard/rust-plist/issues/20/comments","events_url":"https://api.github.com/repos/ebarnard/rust-plist/issues/20/events","html_url":"https://github.com/ebarnard/rust-plist/issues/20","id":221970203,"number":20,"title":"Cannot read an empty binary plist","user":{"login":"kennytm","id":103023,"avatar_url":"https://avatars2.githubusercontent.com/u/103023?v=3","gravatar_id":"","url":"https://api.github.com/users/kennytm","html_url":"https://github.com/kennytm","followers_url":"https://api.github.com/users/kennytm/followers","following_url":"https://api.github.com/users/kennytm/following{/other_user}","gists_url":"https://api.github.com/users/kennytm/gists{/gist_id}","starred_url":"https://api.github.com/users/kennytm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kennytm/subscriptions","organizations_url":"https://api.github.com/users/kennytm/orgs","repos_url":"https://api.github.com/users/kennytm/repos","events_url":"https://api.github.com/users/kennytm/events{/privacy}","received_events_url":"https://api.github.com/users/kennytm/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-04-15T20:16:42Z","updated_at":"2017-04-19T08:33:58Z","closed_at":"2017-04-19T08:33:05Z","body":"**Test case:** (file is taken from iOS 10.3 file system image)\r\n\r\n```rust\r\nextern crate plist;\r\nuse std::io::Cursor;\r\npub fn main() {\r\n    let empty_plist = b\"bplist00\\xd0\\x08\\0\\0\\0\\0\\0\\0\\x01\\x01\\0\\0\\0\\0\\0\\0\\0\\x01\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\t\";\r\n    plist::Plist::read(Cursor::new(&empty_plist[..])).unwrap();\r\n}\r\n```\r\n\r\n**Expected**: The program finishes with no error.\r\n**Actual**: The program panics with:\r\n\r\n```\r\nthread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: InvalidData', src/libcore/result.rs:859\r\nnote: Run with `RUST_BACKTRACE=1` for a backtrace.\r\n```\r\n\r\nPlease compare with Python 3's `plistlib`:\r\n\r\n```python\r\n>>> import plistlib\r\n>>> plistlib.loads(b\"bplist00\\xd0\\x08\\0\\0\\0\\0\\0\\0\\x01\\x01\\0\\0\\0\\0\\0\\0\\0\\x01\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\t\")\r\n{}\r\n```\r\n\r\n\r\n----\r\n\r\nTested with commit 1df5db00 (current master)\r\n\r\n```\r\n$ rustc -vV\r\nrustc 1.18.0-nightly (28a742997 2017-04-13)\r\nbinary: rustc\r\ncommit-hash: 28a74299778cdad4ea999e4ee8f8c1ef793338bd\r\ncommit-date: 2017-04-13\r\nhost: x86_64-apple-darwin\r\nrelease: 1.18.0-nightly\r\nLLVM version: 3.9\r\n```"},"comment":{"url":"https://api.github.com/repos/ebarnard/rust-plist/issues/comments/295163826","html_url":"https://github.com/ebarnard/rust-plist/issues/20#issuecomment-295163826","issue_url":"https://api.github.com/repos/ebarnard/rust-plist/issues/20","id":295163826,"user":{"login":"ebarnard","id":1059683,"avatar_url":"https://avatars3.githubusercontent.com/u/1059683?v=3","gravatar_id":"","url":"https://api.github.com/users/ebarnard","html_url":"https://github.com/ebarnard","followers_url":"https://api.github.com/users/ebarnard/followers","following_url":"https://api.github.com/users/ebarnard/following{/other_user}","gists_url":"https://api.github.com/users/ebarnard/gists{/gist_id}","starred_url":"https://api.github.com/users/ebarnard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ebarnard/subscriptions","organizations_url":"https://api.github.com/users/ebarnard/orgs","repos_url":"https://api.github.com/users/ebarnard/repos","events_url":"https://api.github.com/users/ebarnard/events{/privacy}","received_events_url":"https://api.github.com/users/ebarnard/received_events","type":"User","site_admin":false},"created_at":"2017-04-19T08:33:58Z","updated_at":"2017-04-19T08:33:58Z","body":"Thanks for the report. Fixed in 0.1.3."}}
{"actor":{"display_login":"ebarnard"}}