summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a21477b)
raw | patch | inline | side by side (parent: a21477b)
author | Florian Forster <octo@collectd.org> | |
Tue, 2 May 2017 08:26:40 +0000 (10:26 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Tue, 2 May 2017 08:26:40 +0000 (10:26 +0200) |
The allocated buffer includes a null byte, but the network packet doesn't.
That means we were reading one byte too many from the buffer, overwriting
the terminating null byte in the buffer.
That means we were reading one byte too many from the buffer, overwriting
the terminating null byte in the buffer.
src/libcollectdclient/network_parse.c | patch | blob | history |
index 7139c9bc02fa0fa93efe35e22e365a248625195a..83a05d4f37d0da8b1e907de91bdd00a14dede122 100644 (file)
return ENOMEM;
char username[((size_t)username_len) + 1];
memset(username, 0, sizeof(username));
- if (buffer_next(b, username, sizeof(username)))
+ if (buffer_next(b, username, (size_t)username_len))
return EINVAL;
char const *password = opts->password_lookup(username);