X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fnetwork.c;h=3f39aac2d3f8566a0a42d9ab6ed9b47e0767bda0;hb=2f70742ed2b39ad7f0cecc942803f04c0f98c31d;hp=6be4ed59521b8b80c2ec9e5220dea961a60fc8d8;hpb=f14bb45d570e0b34bdd3a2a0cadfe414c3dfda40;p=collectd.git diff --git a/src/network.c b/src/network.c index 6be4ed59..3f39aac2 100644 --- a/src/network.c +++ b/src/network.c @@ -1369,7 +1369,7 @@ static int parse_part_encr_aes256 (sockent_t *se, /* {{{ */ warning_has_been_printed = 1; } - *ret_buffer += ph_length; + *ret_buffer = (void *) (((char *) *ret_buffer) + ph_length); *ret_buffer_size -= ph_length; return (0); @@ -1408,7 +1408,7 @@ static int parse_packet (sockent_t *se, /* {{{ */ (void *) buffer, sizeof (pkg_type)); memcpy ((void *) &pkg_length, - (void *) (buffer + sizeof (pkg_type)), + (void *) (((char *) buffer) + sizeof (pkg_type)), sizeof (pkg_length)); pkg_length = ntohs (pkg_length); @@ -2501,7 +2501,7 @@ static int network_receive (void) /* {{{ */ break; } - ent->data = malloc (*ent->data); + ent->data = malloc (network_config_packet_size); if (ent->data == NULL) { sfree (ent);