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
This commit is contained in:
parent
2b13c53d76
commit
3b29692357
@ -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);
|
||||
|
@ -179,6 +179,7 @@ _http_growbuf(struct httpio *io, size_t len)
|
||||
return (-1);
|
||||
io->buf = tmp;
|
||||
io->bufsize = len;
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user