Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19345)
static size_t ring_buf_used(struct ring_buf *r)
{
- return r->head_offset - r->ctail_offset;
+ return (size_t)(r->head_offset - r->ctail_offset);
}
static size_t ring_buf_avail(struct ring_buf *r)
}
idx = logical_offset % r->alloc;
- l = r->head_offset - logical_offset;
+ l = (size_t)(r->head_offset - logical_offset);
if (l > r->alloc - idx)
l = r->alloc - idx;
assert(i < 2);
if (total_len + src_len > max_len)
- src_len = max_len - total_len;
+ src_len = (size_t)(max_len - total_len);
iov[num_iov_].buf = src;
iov[num_iov_].buf_len = src_len;