Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@deweerdt
Copy link
Member

@deweerdt deweerdt commented Mar 8, 2019

*((struct sockaddr_storage *)&sin); would cause a read that's larger
than sin, reaching to other parts of the stack. We fix this with a
memcpy that only reads sizeof(sin); bytes.

`*((struct sockaddr_storage *)&sin);` would cause a read that's larger
than `sin`, reaching to other parts of the stack. We fix this with a
memcpy that only reads `sizeof(sin);` bytes.
@deweerdt deweerdt requested a review from i110 March 8, 2019 18:59
@kazuho
Copy link
Member

kazuho commented Mar 8, 2019

Nice catch! How about 8f27b03?

@deweerdt
Copy link
Member Author

deweerdt commented Mar 8, 2019

8f27b03 is even better, @kazuho. Thank you.

…pends on the enviroment, avoid invalid read on stack due to sizeof(sockaddr_storage) > sizeof(sockaddr_in)
@deweerdt
Copy link
Member Author

I've cherry picked 8f27b03 in this PR as 2bbb1ca

@kazuho
Copy link
Member

kazuho commented Mar 22, 2019

Oh thank you for moving this forward. Please merge once the CI succeeds.

@deweerdt deweerdt merged commit 13a9bf8 into h2o:master Mar 22, 2019
@deweerdt
Copy link
Member Author

done, thank you 👍

@deweerdt deweerdt deleted the mruby-invalid-read branch March 22, 2019 17:55
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.

2 participants