[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
hobbitfetch core dump fix
- To: hobbit (at) hswn.dk
- Subject: hobbitfetch core dump fix
- From: Cade Robinson <cade.robinson (at) gmail.com>
- Date: Fri, 05 Feb 2010 08:24:20 -0600
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:content-type :date:message-id:mime-version:x-mailer; bh=tdZHUNInDO4DOXZPoo4X5o/EikMqjLJh+EUQX5xf1YE=; b=rgpzyT+XbeFgWhqxAWx+1/8jpMjx4eEJD/Tk/PGcp5zDIkLg/m9U6yx23F+Qp0WrPg rpeBrnhhvI3N6MR6XwQ84Vqwm+Z0XYJk+f+O3YzARTKRWBmnkuf0Kcb4sCGDG2/Vl48T GVbzoSG3sPzAzpayxABshlgFIVoS9lk1WlDHM=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:content-type:date:message-id:mime-version:x-mailer; b=ia0/2s1jT2gpDKiw+u6vmFu/IkB5F0eAqfLqtaZE7mi1bQtr8abGpXheYKJ7kKBFab mVA5nplTsk502+kkrq0RUdpjUJ+8dx6cqrLWo6p0gG+0/elLPXFVwZXKy8PQDuetsSGy T1G6Oh35KJ8tRuzKx0yEtQqUKZl+SzYOq+tg8=
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.