[core] allocate unix socket paths with SUN_LEN()+1 (fixes #2962)
(thx lighthouse2) x-ref: "SUN_LEN in sock_addr.c (1.4.53, 1.4.54)" https://redmine.lighttpd.net/issues/2962personal/stbuehler/ci-build
parent
cc492d438b
commit
186ce8a2b1
|
@ -544,10 +544,9 @@ int sock_addr_from_str_hints(server *srv, sock_addr *saddr, socklen_t *len, cons
|
|||
}
|
||||
memcpy(saddr->un.sun_path, str, hostlen);
|
||||
#if defined(SUN_LEN)
|
||||
*len = SUN_LEN(&saddr->un);
|
||||
*len = SUN_LEN(&saddr->un)+1;
|
||||
#else
|
||||
/* stevens says: */
|
||||
*len = hostlen + sizeof(saddr->un.sun_family);
|
||||
*len = offsetof(struct sockaddr_un, sun_path) + hostlen;
|
||||
#endif
|
||||
}
|
||||
return 1;
|
||||
|
|
Loading…
Reference in New Issue