[gnutls-devel] GnuTLS | crypto-api: add gnutls_aead_cipher_{en, de}crypt_vec (!1052)
Development of GNU's TLS library
gnutls-devel at lists.gnutls.org
Thu Aug 8 15:51:55 CEST 2019
Simo Sorce commented on a discussion on lib/iov.h: https://gitlab.com/gnutls/gnutls/merge_requests/1052#note_201640333
> + iter->iov_index = 0;
> + iter->iov_offset = 0;
> + iter->block_size = block_size;
> + iter->block_offset = 0;
> + return 0;
> +}
> +
> +/* Retrieve the current block(s) pointed by @iter and advance it to
> + * the next buffer. */
> +static inline int
> +iov_iter_next(struct iov_iter_st *iter, uint8_t **data, size_t *blocks)
> +{
> + while (iter->iov_index < iter->iov_count) {
> + const giovec_t *iov = &iter->iov[iter->iov_index];
> + uint8_t *p = iov->iov_base;
> + ssize_t len = iov->iov_len;
It's dangerous to cast len though, because if it becomes negative via DECR_LEN macro then your cast will compare as greater instead of smaller. Why the cast ?
--
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/merge_requests/1052#note_201640333
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20190808/b05dae0d/attachment-0001.html>
More information about the Gnutls-devel
mailing list