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

Buffer overflow when reading into small buffer #66

Closed
pixelspark opened this issue May 18, 2017 · 3 comments
Closed

Buffer overflow when reading into small buffer #66

pixelspark opened this issue May 18, 2017 · 3 comments

Comments

@pixelspark
Copy link

This doesn't seem right:

https://github.com/IBM-Swift/BlueSocket/blob/master/Sources/Socket.swift#L2491

When truncate == true, the memcpy copies self.readStorage.length bytes into the buffer passed as parameter, which has a smaller size (bufSize) than that!

Below the memcpy is correct:

https://github.com/IBM-Swift/BlueSocket/blob/master/Sources/Socket.swift#L2538

@billabt
Copy link
Collaborator

billabt commented May 18, 2017

I'll take a look. Thanks for the heads up.

@billabt
Copy link
Collaborator

billabt commented May 19, 2017

@pixelspark: You were right. Must've been a cut/paste error. Thanks for pointing this out. It's fixed in the current release.

@billabt billabt closed this as completed May 19, 2017
@pixelspark
Copy link
Author

Many 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

No branches or pull requests

2 participants