Commit d2b54402 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Clamp # of iovec to IOV_MAX

parent fe9d181a
......@@ -37,6 +37,7 @@
#include <sys/types.h>
#include <sys/uio.h>
#include <limits.h>
#include <stdio.h>
#include "cache.h"
......@@ -82,6 +83,8 @@ WRW_Reserve(struct worker *wrk, int *fd)
u = WS_Reserve(wrk->aws, 0);
u = PRNDDN(u);
u /= sizeof(struct iovec);
if (u > IOV_MAX)
u = IOV_MAX;
AN(u);
wrw->iov = (void*)PRNDUP(wrk->aws->f);
wrw->siov = u;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment