mirror of
https://github.com/samba-team/samba.git
synced 2025-08-31 22:02:58 +03:00
r1248: Fix from Nick Wellnhofer <wellnhofer@aevum.de> to prevent
lp_interfaces() list from being corrupted. Jeremy.
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
b462b8fa2f
commit
c892545960
@ -94,7 +94,7 @@ This handles the following different forms:
|
|||||||
4) ip/mask
|
4) ip/mask
|
||||||
5) bcast/mask
|
5) bcast/mask
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
static void interpret_interface(const char *token)
|
static void interpret_interface(char *token)
|
||||||
{
|
{
|
||||||
struct in_addr ip, nmask;
|
struct in_addr ip, nmask;
|
||||||
char *p;
|
char *p;
|
||||||
@ -130,9 +130,9 @@ static void interpret_interface(const char *token)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* parse it into an IP address/netmasklength pair */
|
/* parse it into an IP address/netmasklength pair */
|
||||||
*p++ = 0;
|
*p = 0;
|
||||||
|
|
||||||
ip = *interpret_addr2(token);
|
ip = *interpret_addr2(token);
|
||||||
|
*p++ = '/';
|
||||||
|
|
||||||
if (strlen(p) > 2) {
|
if (strlen(p) > 2) {
|
||||||
nmask = *interpret_addr2(p);
|
nmask = *interpret_addr2(p);
|
||||||
@ -207,7 +207,11 @@ void load_interfaces(void)
|
|||||||
|
|
||||||
if (ptr) {
|
if (ptr) {
|
||||||
while (*ptr) {
|
while (*ptr) {
|
||||||
interpret_interface(*ptr);
|
char *ptr_cpy = strdup(*ptr);
|
||||||
|
if (ptr_cpy) {
|
||||||
|
interpret_interface(ptr_cpy);
|
||||||
|
free(ptr_cpy);
|
||||||
|
}
|
||||||
ptr++;
|
ptr++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user