Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
coLunacyDNS: Fix bug where we improperly use FD_ISSET w.r.t. select()
If you use FD_ISSET on a connection never set with FD_SET, this triggers
a buffer overflow in Ubuntu’s 20.04 glibc.  Fixed.

Found when updating tests for https://github.com/samboy/MaraDNS/issues/91

This *also* means we will need to make a coLunacyDNS 1.0.010
  • Loading branch information
Sam Trenholme committed Dec 14, 2020
1 parent 3cff85f commit 964d789
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion deadwood-github/tools/coLunacyDNS/coLunacyDNS.c
Expand Up @@ -2065,7 +2065,8 @@ void runServer(lua_State *L) {
if(FD_ISSET(localConn4, &selectFdSet)) {
sock4 = localConn4;
selectOut -= 1;
} else if(FD_ISSET(localConn6, &selectFdSet)) {
} else if(localConn6 != INVALID_SOCKET &&
FD_ISSET(localConn6, &selectFdSet)) {
sock6 = localConn6;
selectOut -= 1;
} else {
Expand Down

0 comments on commit 964d789

Please sign in to comment.