From: Florian Forster Date: Wed, 6 May 2009 09:23:17 +0000 (+0200) Subject: network plugin: Fix use of a uninitialized variable. X-Git-Tag: collectd-4.7.0~5 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=950e67e00dab1ec4bc2ea4177263c14b4abdac18;p=collectd.git network plugin: Fix use of a uninitialized variable. This only happened if debugging was enabled. --- diff --git a/src/network.c b/src/network.c index 274d2d82..0a74a190 100644 --- a/src/network.c +++ b/src/network.c @@ -2261,9 +2261,6 @@ static void networt_send_buffer_encrypted (sockent_t *se, /* {{{ */ gcry_error_t err; gcry_cipher_hd_t cypher; - DEBUG ("network plugin: networt_send_buffer_encrypted: " - "buffer_size = %zu;", buffer_size); - /* Initialize the header fields */ memset (&pea, 0, sizeof (pea)); pea.head.type = htons (TYPE_ENCR_AES256); @@ -2282,6 +2279,8 @@ static void networt_send_buffer_encrypted (sockent_t *se, /* {{{ */ - sizeof (pea.hash); assert (buffer_size <= sizeof (buffer)); + DEBUG ("network plugin: networt_send_buffer_encrypted: " + "buffer_size = %zu;", buffer_size); pea.head.length = htons ((uint16_t) (PART_ENCRYPTION_AES256_SIZE + username_len + in_buffer_size));