Xymon Mailing List Archive search

hobbitfetch core dump fix

list Cade Robinson
Fri, 05 Feb 2010 08:24:20 -0600
Message-Id: <user-5dcfa3743bca@xymon.invalid>

I was having issues with hobbitfetch core dumping.
I finally figured out the issue.

In the "grabdata" function there is:
int n;
char buf[8192];

/* Read data from a peer connection (client or server) */
n = read(conn->sockfd, buf, sizeof(buf));
...
else if (n > 0) {
...
buf[n] = '\0';
...

If 8192 bytes are read then "n" is 8192.  There is no element 8192 in
buf.  buf is 0-8191.