summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 294aa61)
raw | patch | inline | side by side (parent: 294aa61)
author | Pavel Rochnyack <pavel2000@ngs.ru> | |
Mon, 3 Apr 2017 05:57:09 +0000 (11:57 +0600) | ||
committer | Florian Forster <octo@collectd.org> | |
Tue, 4 Apr 2017 08:48:18 +0000 (10:48 +0200) |
When correct 'Signature part' is received by Collectd, configured without
AuthFile option, condition for endless loop occurs due to missing increase
of pointer to next unprocessed part.
This is a forward-port of #2233.
Fixes: CVE-2017-7401
Closes: #2174
Signed-off-by: Florian Forster <octo@collectd.org>
AuthFile option, condition for endless loop occurs due to missing increase
of pointer to next unprocessed part.
This is a forward-port of #2233.
Fixes: CVE-2017-7401
Closes: #2174
Signed-off-by: Florian Forster <octo@collectd.org>
src/network.c | patch | blob | history |
diff --git a/src/network.c b/src/network.c
index be4c3baeb71b42dbc13ec74e59382c09ced1c488..2ff09af3f9dccea1d9fa4c9d0fe8a077aff1566e 100644 (file)
--- a/src/network.c
+++ b/src/network.c
buffer_len = *ret_buffer_len;
buffer_offset = 0;
- if (se->data.server.userdb == NULL) {
- c_complain(
- LOG_NOTICE, &complain_no_users,
- "network plugin: Received signed network packet but can't verify it "
- "because no user DB has been configured. Will accept it.");
- return (0);
- }
-
/* Check if the buffer has enough data for this structure. */
if (buffer_len <= PART_SIGNATURE_SHA256_SIZE)
return (-ENOMEM);
return (-1);
}
+ if (se->data.server.userdb == NULL) {
+ c_complain(
+ LOG_NOTICE, &complain_no_users,
+ "network plugin: Received signed network packet but can't verify it "
+ "because no user DB has been configured. Will accept it.");
+
+ *ret_buffer = buffer + pss_head_length;
+ *ret_buffer_len -= pss_head_length;
+
+ return (0);
+ }
+
/* Copy the hash. */
BUFFER_READ(pss.hash, sizeof(pss.hash));