summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 372705b)
raw | patch | inline | side by side (parent: 372705b)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sat, 31 Jan 2009 22:28:21 +0000 (23:28 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sat, 31 Jan 2009 22:28:21 +0000 (23:28 +0100) |
The size passed to `strncat' is not the total size of the buffer, so GCC
with _FORTIFY_SOURCE rightfully complained about this macro.
Thanks to dD0T for reporting this :)
with _FORTIFY_SOURCE rightfully complained about this macro.
Thanks to dD0T for reporting this :)
src/libcollectdclient/client.c | patch | blob | history |
index c5be3b90cec373ad1d6469fb2a9e1faa0d5e5154..847eafc948857d8aaeb10b9023a651a2a3c299b2 100644 (file)
} while (0)
#define SSTRCAT(d,s) do { \
- strncat ((d), (s), sizeof (d)); \
+ size_t _l = strlen (d); \
+ strncpy ((d) + _l, (s), sizeof (d) - _l); \
(d)[sizeof (d) - 1] = 0; \
} while (0)
int lcc_flush (lcc_connection_t *c, const char *plugin, /* {{{ */
lcc_identifier_t *ident, int timeout)
{
- char command[1024];
+ char command[1024] = "";
lcc_response_t res;
int status;