diff options
| author | Edward Barnard | 2017-03-06 21:08:58 +0000 |
|---|---|---|
| committer | Edward Barnard | 2017-03-06 21:08:58 +0000 |
| commit | 1df5db005ea9959c4e19107997f446dc17095be4 (patch) | |
| tree | 703c0f8b482ed563b72a2b76fc412f59ed3c6540 /tests | |
| parent | e322e26b7e8c3dbfcba5c6142ca7559b63fc1652 (diff) | |
| download | rust-plist-1df5db005ea9959c4e19107997f446dc17095be4.tar.bz2 | |
Limit the number of objects that can be created by the binary parser. Binary plists can contain circular references.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/fuzzer.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/fuzzer.rs b/tests/fuzzer.rs index 4d7b151..65ce8eb 100644 --- a/tests/fuzzer.rs +++ b/tests/fuzzer.rs @@ -21,6 +21,12 @@ fn empty_offset_table() { test_fuzzer_data_err(data); } +#[test] +fn binary_circular_reference() { + let data = b"bplist00\xd6\x01\x02\x03\x04\x05\x06\x07\x0a\x0b\x0c\x0d\x0eULinesUDeathVHeightYBirthdateVAutbplist00\xd6\x01\x02\x03\x04\x05\x06\x07\x0a\x0b\x0c\x0d\x0eULinesUDeathVHeightYBirthdateVAuthorTData\xa2\x08\x09_\x10\x1eIt is nifying nothing.\x11\x06\x1c#?\xf9\x99\x99\x99\x99\x99\x9a3\xc1\xc2v\x00e\x00\x00\x00_\x10\x13William ShakespeareO\x10\x0f\x00\x00\x00\xbe\x00\x00\x00\x03\x00\x00\x00\x1e\x00\x00\x00\x08\x15\x1b!(58>Ab\x90\x93\x9c\xa5\xbb\x00\x00\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xcd"; + test_fuzzer_data_err(data); +} + fn test_fuzzer_data_err(data: &[u8]) { let cursor = Cursor::new(data); let res = Plist::read(cursor); |
