summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2745f0c)
raw | patch | inline | side by side (parent: 2745f0c)
author | Florian Forster <octo@crystal.wlan.home.verplant.org> | |
Tue, 30 Dec 2008 16:13:31 +0000 (17:13 +0100) | ||
committer | Florian Forster <octo@crystal.wlan.home.verplant.org> | |
Tue, 30 Dec 2008 16:13:31 +0000 (17:13 +0100) |
This patch fixes the same problem as 6605ff1a, the insufficient copying of
values to the `type' buffer.
Thanks again to Bruno Prémont for reporting and debugging this :)
Resolves: #37
values to the `type' buffer.
Thanks again to Bruno Prémont for reporting and debugging this :)
Resolves: #37
src/network.c | patch | blob | history |
diff --git a/src/network.c b/src/network.c
index 0ea51b3bba7e6e7b381f3ca9c9724ddd2cba2232..3a52a43d74db22c3457cb1358e48eaf68a6f2b4c 100644 (file)
--- a/src/network.c
+++ b/src/network.c
} /* void network_send_buffer */
static int add_to_buffer (char *buffer, int buffer_size,
- value_list_t *vl_def, char *type_def,
+ value_list_t *vl_def, char *type_def, size_t type_def_size,
const data_set_t *ds, const value_list_t *vl)
{
char *buffer_orig = buffer;
if (write_part_string (&buffer, &buffer_size, TYPE_TYPE,
ds->type, strlen (ds->type)) != 0)
return (-1);
- sstrncpy (type_def, ds->type, sizeof (type_def));
+ sstrncpy (type_def, ds->type, type_def_size);
}
if (strcmp (vl_def->type_instance, vl->type_instance) != 0)
status = add_to_buffer (send_buffer_ptr,
sizeof (send_buffer) - send_buffer_fill,
- &send_buffer_vl, send_buffer_type,
+ &send_buffer_vl,
+ send_buffer_type, sizeof (send_buffer_type),
ds, vl);
if (status >= 0)
{
status = add_to_buffer (send_buffer_ptr,
sizeof (send_buffer) - send_buffer_fill,
- &send_buffer_vl, send_buffer_type,
+ &send_buffer_vl,
+ send_buffer_type, sizeof (send_buffer_type),
ds, vl);
if (status >= 0)