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

Fix #167 #168

Merged
merged 3 commits into from
Jan 14, 2020
Merged

Fix #167 #168

merged 3 commits into from
Jan 14, 2020

Conversation

aembke
Copy link
Contributor

@aembke aembke commented Oct 1, 2019

Fixes #167 and prevents panics found in the stringify function when fuzzing with AFL.

Also adds a number of tests to reproduce the fuzzing results and to test the changes to the parsing logic.

aembke added 3 commits October 1, 2019 08:23
…avoid modifying the buffer used to generate string slices
…-safety

Fix/json stringify panic json parse safety
@@ -66,20 +66,20 @@ pub trait Generator {

#[inline(never)]
fn write_string_complex(&mut self, string: &str, mut start: usize) -> io::Result<()> {
self.write(string[ .. start].as_bytes())?;
self.write(&string.as_bytes()[ .. start])?;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the changes in this function prevent panics when indexing into a string at a byte offset that doesn't fall on a character boundary

@maciejhirsz maciejhirsz merged commit bbca97e into maciejhirsz:master Jan 14, 2020
@maciejhirsz
Copy link
Owner

Thank you!

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

Successfully merging this pull request may close these issues.

Fails to correctly parse key with escaped forward slash
3 participants