projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'collectd-5.4' into collectd-5.5
[collectd.git]
/
src
/
network.c
diff --git
a/src/network.c
b/src/network.c
index
af24911
..
7c15e8f
100644
(file)
--- a/
src/network.c
+++ b/
src/network.c
@@
-500,6
+500,8
@@
static int network_dispatch_notification (notification_t *n) /* {{{ */
#if HAVE_LIBGCRYPT
static void network_init_gcrypt (void) /* {{{ */
{
#if HAVE_LIBGCRYPT
static void network_init_gcrypt (void) /* {{{ */
{
+ gcry_error_t err;
+
/* http://lists.gnupg.org/pipermail/gcrypt-devel/2003-August/000458.html
* Because you can't know in a library whether another library has
* already initialized the library */
/* http://lists.gnupg.org/pipermail/gcrypt-devel/2003-August/000458.html
* Because you can't know in a library whether another library has
* already initialized the library */
@@
-514,10
+516,23
@@
static void network_init_gcrypt (void) /* {{{ */
*
* tl;dr: keep all these gry_* statements in this exact order please. */
# if GCRYPT_VERSION_NUMBER < 0x010600
*
* tl;dr: keep all these gry_* statements in this exact order please. */
# if GCRYPT_VERSION_NUMBER < 0x010600
- gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
+ err = gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
+ if (err)
+ {
+ ERROR ("network plugin: gcry_control (GCRYCTL_SET_THREAD_CBS) failed: %s", gcry_strerror (err));
+ abort ();
+ }
# endif
# endif
+
gcry_check_version (NULL);
gcry_check_version (NULL);
- gcry_control (GCRYCTL_INIT_SECMEM, 32768);
+
+ err = gcry_control (GCRYCTL_INIT_SECMEM, 32768);
+ if (err)
+ {
+ ERROR ("network plugin: gcry_control (GCRYCTL_SET_THREAD_CBS) failed: %s", gcry_strerror (err));
+ abort ();
+ }
+
gcry_control (GCRYCTL_INITIALIZATION_FINISHED);
} /* }}} void network_init_gcrypt */
gcry_control (GCRYCTL_INITIALIZATION_FINISHED);
} /* }}} void network_init_gcrypt */
@@
-1444,6
+1459,7
@@
static int parse_packet (sockent_t *se, /* {{{ */
printed_ignore_warning = 1;
}
buffer = ((char *) buffer) + pkg_length;
printed_ignore_warning = 1;
}
buffer = ((char *) buffer) + pkg_length;
+ buffer_size -= (size_t) pkg_length;
continue;
}
#endif /* HAVE_LIBGCRYPT */
continue;
}
#endif /* HAVE_LIBGCRYPT */
@@
-1471,6
+1487,7
@@
static int parse_packet (sockent_t *se, /* {{{ */
printed_ignore_warning = 1;
}
buffer = ((char *) buffer) + pkg_length;
printed_ignore_warning = 1;
}
buffer = ((char *) buffer) + pkg_length;
+ buffer_size -= (size_t) pkg_length;
continue;
}
#endif /* HAVE_LIBGCRYPT */
continue;
}
#endif /* HAVE_LIBGCRYPT */
@@
-1612,6
+1629,7
@@
static int parse_packet (sockent_t *se, /* {{{ */
DEBUG ("network plugin: parse_packet: Unknown part"
" type: 0x%04hx", pkg_type);
buffer = ((char *) buffer) + pkg_length;
DEBUG ("network plugin: parse_packet: Unknown part"
" type: 0x%04hx", pkg_type);
buffer = ((char *) buffer) + pkg_length;
+ buffer_size -= (size_t) pkg_length;
}
} /* while (buffer_size > sizeof (part_header_t)) */
}
} /* while (buffer_size > sizeof (part_header_t)) */