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

Crash waiting to happen? #30

Closed
codecat opened this issue Aug 24, 2016 · 1 comment · Fixed by #31
Closed

Crash waiting to happen? #30

codecat opened this issue Aug 24, 2016 · 1 comment · Fixed by #31

Comments

@codecat
Copy link
Contributor

codecat commented Aug 24, 2016

So I stumbled upon this: https://github.com/sheredom/utf8.h/blob/master/utf8.h#L697

Is this a crash waiting to happen, or am I reading the logic wrong?

If both h and n are equal strings, this will read past the memory of those strings.

@sheredom
Copy link
Owner

Hmm you are probably right! I'll add a test for that and we'll make sure it fails, then probably have to add on a check for null terminator there too.

Good find thanks! 😄

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 a pull request may close this issue.

2 participants