The safe pointer that is computed is an exclusive, not inclusive bounds.
While we were probably rarely ever bit this, if ever, it still makes
sense to apply the limit, properly.
if (dist >= len || dist >= state->chunksize)
out = chunkcopy_safe(out, out - dist, len, safe);
else
- out = CHUNKMEMSET_SAFE(out, dist, len, (unsigned)((safe - out) + 1));
+ out = CHUNKMEMSET_SAFE(out, dist, len, (unsigned)((safe - out)));
} else {
/* Whole reference is in range of current output. No range checks are
necessary because we start with room for at least 258 bytes of output,