Skip to content

[OKTA-251323] y u do dis #4

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

Merged
merged 2 commits into from
Oct 1, 2019
Merged

[OKTA-251323] y u do dis #4

merged 2 commits into from
Oct 1, 2019

Conversation

alecembke-okta
Copy link

No description provided.

let mut ch = b'\\';

// TODO: Use fastwrite here as well
self.buffer.extend_from_slice(self.source[start .. self.index - 1].as_bytes());
self.buffer.extend_from_slice(&self.source.as_bytes()[start .. self.index - 1]);
Copy link
Author

Choose a reason for hiding this comment

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

this isn't related to the fix for this issue, but it's bad form and could cause a panic

@@ -554,7 +556,7 @@ impl<'a> Parser<'a> {
// issues here, we construct a new slice from raw parts, which
// then has lifetime bound to the outer function scope instead
// of the parser itself.
slice::from_raw_parts(self.buffer.as_ptr(), self.buffer.len())
slice::from_raw_parts(self.buffer[len..].as_ptr(), self.buffer.len() - len)
Copy link
Author

Choose a reason for hiding this comment

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

fun fact, i forgot to add the - len here at the end at first and the next 3 bytes in memory on my machine were red, and it didn't segfault.

@alecembke-okta alecembke-okta merged commit 815b1f4 into master Oct 1, 2019
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.

3 participants