From: Florian Forster Date: Sun, 28 Jun 2015 13:05:36 +0000 (+0200) Subject: Merge branch 'collectd-5.4' into collectd-5.5 X-Git-Tag: collectd-5.5.1~90 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=79593ed5e0a3def8e91be5b1de15a536af2d4a92;hp=ba5d00054e24261b3b8cbbef56dc6e6ae54f61bc;p=collectd.git Merge branch 'collectd-5.4' into collectd-5.5 --- diff --git a/src/daemon/common.c b/src/daemon/common.c index 47203991..b2448086 100644 --- a/src/daemon/common.c +++ b/src/daemon/common.c @@ -514,7 +514,7 @@ int escape_slashes (char *buffer, size_t buffer_size) buffer_len--; } - for (i = 0; i < buffer_len - 1; i++) + for (i = 0; i < buffer_len; i++) { if (buffer[i] == '/') buffer[i] = '_'; diff --git a/src/df.c b/src/df.c index 61964f3c..cb0ff2ff 100644 --- a/src/df.c +++ b/src/df.c @@ -321,7 +321,7 @@ static int df_read (void) } /* inode handling */ - if (report_inodes) + if (report_inodes && statbuf.f_files != 0 && statbuf.f_ffree != 0) { uint64_t inode_free; uint64_t inode_reserved; diff --git a/src/tcpconns.c b/src/tcpconns.c index b6a3fdda..5d4bb696 100644 --- a/src/tcpconns.c +++ b/src/tcpconns.c @@ -982,7 +982,9 @@ static int conn_read (void) #endif { /* Read the pcb pointed to by `next' into `inpcb' */ - kread ((u_long) next, &inpcb, sizeof (inpcb)); + status = kread ((u_long) next, &inpcb, sizeof (inpcb)); + if (status != 0) + return (-1); /* Advance `next' */ #if defined(__OpenBSD__) || (defined(__NetBSD_Version__) && __NetBSD_Version__ > 699002700) @@ -1005,7 +1007,9 @@ static int conn_read (void) continue; #endif - kread ((u_long) inpcb.inp_ppcb, &tcpcb, sizeof (tcpcb)); + status = kread ((u_long) inpcb.inp_ppcb, &tcpcb, sizeof (tcpcb)); + if (status != 0) + return (-1); conn_handle_ports (ntohs(inpcb.inp_lport), ntohs(inpcb.inp_fport), tcpcb.t_state); } /* while (next != head) */