Skip to content
Snippets Groups Projects
Commit 7ee11537 authored by Dmitry E. Oboukhov's avatar Dmitry E. Oboukhov
Browse files

Fix trash in socket:peername/name if it is UNIX-socket.

parent 509d8074
No related branches found
No related tags found
No related merge requests found
......@@ -627,10 +627,16 @@ lbox_bsdsocket_push_addr(struct lua_State *L,
lua_pushliteral(L, "unix/");
lua_rawset(L, -3);
lua_pushliteral(L, "port");
lua_pushstring(L,
((struct sockaddr_un *)addr)->sun_path);
lua_rawset(L, -3);
if (alen > sizeof(addr->sa_family)) {
lua_pushliteral(L, "port");
lua_pushstring(L,
((struct sockaddr_un *)addr)->sun_path);
lua_rawset(L, -3);
} else {
lua_pushliteral(L, "port");
lua_pushliteral(L, "");
lua_rawset(L, -3);
}
break;
default: /* unknown family */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment