# HG changeset patch # User jbe # Date 1511483543 -3600 # Node ID 426848ae610825668af0c1f29766ce7c47547654 # Parent 7751e49829167ff6ef8e0217a917983ef13b460f Bugfix: Properly set sun_len, sun_family, and addrlen when filling sockaddr_un struct (using maximum possible length) diff -r 7751e4982916 -r 426848ae6108 moonbridge.c --- a/moonbridge.c Fri Nov 24 00:44:04 2017 +0100 +++ b/moonbridge.c Fri Nov 24 01:32:23 2017 +0100 @@ -1972,7 +1972,10 @@ if (strlen(path) > path_maxlen) { luaL_error(L, "Path name for local socket exceeded maximum length of %i characters", path_maxlen); } + listener->type_specific.socket.addr.addr_un.sun_len = sizeof(listener->type_specific.socket.addr.addr_un); + listener->type_specific.socket.addr.addr_un.sun_family = AF_LOCAL; strcpy(listener->type_specific.socket.addr.addr_un.sun_path, path); + listener->type_specific.socket.addrlen = sizeof(listener->type_specific.socket.addr.addr_un); } else if (proto && !strcmp(proto, "tcp")) { const char *host, *port; struct addrinfo hints = { 0, };