summaryrefslogtreecommitdiffstats
path: root/lib/libfetch/common.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2002-10-27 15:43:40 +0000
committerdes <des@FreeBSD.org>2002-10-27 15:43:40 +0000
commitc118e55b512ffc30bf0e8ecfe3aa6e152665bbbb (patch)
tree82547677035f49731c110d625a2e087b17869ca0 /lib/libfetch/common.c
parent877e52987a99dbf69b21ba195575a515cf30fdc3 (diff)
downloadFreeBSD-src-c118e55b512ffc30bf0e8ecfe3aa6e152665bbbb.zip
FreeBSD-src-c118e55b512ffc30bf0e8ecfe3aa6e152665bbbb.tar.gz
Eliminate two cases of undefined behaviour: total in _fetch_write() was
not initialized before use, and _http_growbuf() did not return a value on success. Reported by: Peter Edwards <pmedwards@eircom.net> MFC after: 2 weeks
Diffstat (limited to 'lib/libfetch/common.c')
-rw-r--r--lib/libfetch/common.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c
index df6d870..48ac5d3 100644
--- a/lib/libfetch/common.c
+++ b/lib/libfetch/common.c
@@ -465,6 +465,7 @@ _fetch_write(conn_t *conn, const char *buf, size_t len)
timeout.tv_sec += fetchTimeout;
}
+ total = 0;
while (len > 0) {
while (fetchTimeout && !FD_ISSET(conn->sd, &writefds)) {
FD_SET(conn->sd, &writefds);
OpenPOWER on IntegriCloud