if (write_part_string (&buffer, &buffer_size, TYPE_HOST,
vl->host, strlen (vl->host)) != 0)
return (-1);
- strcpy (vl_def->host, vl->host);
+ sstrncpy (vl_def->host, vl->host, sizeof (vl_def->host));
}
if (vl_def->time != vl->time)
if (write_part_string (&buffer, &buffer_size, TYPE_PLUGIN,
vl->plugin, strlen (vl->plugin)) != 0)
return (-1);
- strcpy (vl_def->plugin, vl->plugin);
+ sstrncpy (vl_def->plugin, vl->plugin, sizeof (vl_def->plugin));
}
if (strcmp (vl_def->plugin_instance, vl->plugin_instance) != 0)
vl->plugin_instance,
strlen (vl->plugin_instance)) != 0)
return (-1);
- strcpy (vl_def->plugin_instance, vl->plugin_instance);
+ sstrncpy (vl_def->plugin_instance, vl->plugin_instance, sizeof (vl_def->plugin_instance));
}
if (strcmp (type_def, vl->type) != 0)
if (write_part_string (&buffer, &buffer_size, TYPE_TYPE,
vl->type, strlen (vl->type)) != 0)
return (-1);
- strcpy (type_def, vl->type);
+ sstrncpy (type_def, vl->type, sizeof (type_def));
}
if (strcmp (vl_def->type_instance, vl->type_instance) != 0)
vl->type_instance,
strlen (vl->type_instance)) != 0)
return (-1);
- strcpy (vl_def->type_instance, vl->type_instance);
+ sstrncpy (vl_def->type_instance, vl->type_instance, sizeof (vl_def->type_instance));
}
if (write_part_values (&buffer, &buffer_size, ds, vl) != 0)
fields_num = strsplit (val_cpy, fields, 3);
if ((fields_num != 1)
&& (fields_num != 2))
+ {
+ sfree (val_cpy);
return (1);
+ }
else if (fields_num == 2)
{
if ((service = strchr (fields[1], '.')) != NULL)
network_add_listen_socket (node, service);
else
network_add_sending_socket (node, service);
+
+ sfree (val_cpy);
}
else if (strcasecmp ("TimeToLive", key) == 0)
{