Ensure buffer has enough space
In the case of a Unix domain socket, the required buffer size may in principle be up to PATH_MAX, so better to explicitly ensure that there's enough space.
This commit is contained in:
@ -221,8 +221,12 @@ service_isvalid(SERVICE *service)
|
||||
static int
|
||||
serviceStartPort(SERVICE *service, SERV_LISTENER *port)
|
||||
{
|
||||
const size_t ANY_IPV4_ADDRESS_LEN = 7; // strlen("0:0:0:0");
|
||||
|
||||
int listeners = 0;
|
||||
char config_bind[40];
|
||||
size_t config_bind_len =
|
||||
(port->address ? strlen(port->address) : ANY_IPV4_ADDRESS_LEN) + 1 + UINTLEN(port->port);
|
||||
char config_bind[config_bind_len + 1]; // +1 for NULL
|
||||
GWPROTOCOL *funcs;
|
||||
|
||||
if (service == NULL || service->router == NULL || service->router_instance == NULL)
|
||||
|
||||
Reference in New Issue
Block a user