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

Unsafe use of strstr() on non-null-terminated string #93

Open
newacct opened this issue Oct 20, 2011 · 0 comments
Open

Unsafe use of strstr() on non-null-terminated string #93

newacct opened this issue Oct 20, 2011 · 0 comments

Comments

@newacct
Copy link

newacct commented Oct 20, 2011

In [SA_OAuthTwitterController webView:shouldStartLoadWithRequest:navigationType:], you get the bytes from an NSData using [data bytes], and then in the next line you proceed to use strstr() on it. However, strstr() requires that its arguments are null-terminated, and there is no guarantee that the bytes you get from [NSData bytes] are null-terminated. If the substring is not found, it will run off the end of the buffer.

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

No branches or pull requests

1 participant