In parse_identifier_vl function (common.c), the value passed to
sstrncpy as buffer length is the sizeof a char pointer, which
is 4bytes for 32bit arch and 8bytes for 64 bit ones.
This patch fix the length and truncate the buffer to the same size as
destination buffer.
Signed-off-by: Andres J. Diaz <ajdiaz@connectical.com>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
if (status != 0)
return (status);
if (status != 0)
return (status);
- sstrncpy (vl->host, host, sizeof (host));
- sstrncpy (vl->plugin, plugin, sizeof (plugin));
+ sstrncpy (vl->host, host, sizeof (vl->host));
+ sstrncpy (vl->plugin, plugin, sizeof (vl->plugin));
sstrncpy (vl->plugin_instance,
(plugin_instance != NULL) ? plugin_instance : "",
sstrncpy (vl->plugin_instance,
(plugin_instance != NULL) ? plugin_instance : "",
- sizeof (plugin_instance));
- sstrncpy (vl->type, type, sizeof (type));
+ sizeof (vl->plugin_instance));
+ sstrncpy (vl->type, type, sizeof (vl->type));
sstrncpy (vl->type_instance,
(type_instance != NULL) ? type_instance : "",
sstrncpy (vl->type_instance,
(type_instance != NULL) ? type_instance : "",
- sizeof (type_instance));
+ sizeof (vl->type_instance));
return (0);
} /* }}} int parse_identifier_vl */
return (0);
} /* }}} int parse_identifier_vl */