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

Fix an off-by one causing extremely rare asserts: We must have two

free slots, one for the data we want to write and one for the
end of chunk bits.

Fixes: #2207
parent 64407985
......@@ -239,7 +239,7 @@ V1L_Write(const struct worker *wrk, const void *ptr, ssize_t len)
return (0);
if (len == -1)
len = strlen(ptr);
if (v1l->niov >= v1l->siov - (v1l->ciov < v1l->siov ? 1 : 0))
if (v1l->niov >= v1l->siov - (v1l->ciov < v1l->siov ? 2 : 0))
(void)V1L_Flush(wrk);
v1l->iov[v1l->niov].iov_base = TRUST_ME(ptr);
v1l->iov[v1l->niov].iov_len = len;
......
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