overrun the w->iov.
Because niov is right after iov in struct worker, it is hard to predict
what the effect of hitting this bug, but "core dump" is almost a given.
I don't think it has been likely to happen a lot however, as it would
require a full complement of HTTP headers or a very fragmented object.
Coverity Scan (CID:7)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2369
d4fa192b-c00b-0410-8231-
f00ffab90ce4
ssize_t i;
CHECK_OBJ_NOTNULL(w, WORKER_MAGIC);
- if (*w->wfd < 0 || w->niov == 0 || w->werr)
- return (w->werr);
- i = writev(*w->wfd, w->iov, w->niov);
- if (i != w->liov)
- w->werr++;
+ if (*w->wfd >= 0 && w->niov > 0 && w->werr == 0) {
+ i = writev(*w->wfd, w->iov, w->niov);
+ if (i != w->liov)
+ w->werr++;
+ }
w->liov = 0;
w->niov = 0;
return (w->werr);