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

Unreachable code means invalid get_option behavior on Windows #37

Closed
borrrden opened this issue Jan 17, 2020 · 1 comment
Closed

Unreachable code means invalid get_option behavior on Windows #37

borrrden opened this issue Jan 17, 2020 · 1 comment
Assignees
Labels
bug fix added A fix was added but has yet to be fully tested/verified

Comments

@borrrden
Copy link
Contributor

sockpp/src/socket.cpp

Lines 227 to 230 in d8c86c0

int len = static_cast<int>(*optlen);
return check_ret_bool(::getsockopt(handle_, level, optname,
static_cast<char*>(optval), &len));
*optlen = static_cast<socklen_t>(len);

optlen is set after the return statement

@fpagliughi
Copy link
Owner

Oouch. Now that's a stupid bug.

@fpagliughi fpagliughi added the bug label Jan 18, 2020
@fpagliughi fpagliughi self-assigned this Jan 18, 2020
@fpagliughi fpagliughi added the fix added A fix was added but has yet to be fully tested/verified label Jan 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fix added A fix was added but has yet to be fully tested/verified
Projects
None yet
Development

No branches or pull requests

2 participants