fixes bug with missing \0 in xioparsenetwork

This commit is contained in:
Gerhard Rieger 2008-09-22 08:48:16 +02:00
parent 3d95d9d679
commit b0adfb95ae

View file

@ -1700,6 +1700,7 @@ int xioparsenetwork(const char *rangename, int pf, struct xiorange *range) {
return STAT_NORETRY; return STAT_NORETRY;
} }
strncpy(addrname, rangename, maskname-rangename-1); strncpy(addrname, rangename, maskname-rangename-1);
addrname[maskname-rangename-1] = '\0';
result = result =
dalan(addrname, (char *)&range->netaddr.soa.sa_data, &addrlen, dalan(addrname, (char *)&range->netaddr.soa.sa_data, &addrlen,
sizeof(range->netaddr)-(size_t)(&((struct sockaddr *)0)->sa_data) sizeof(range->netaddr)-(size_t)(&((struct sockaddr *)0)->sa_data)