[gnutls-devel] GnuTLS | sockets: fixed building with compilers without VLA support (!1489)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Fri Nov 26 12:13:37 CET 2021




Evgeny Grin commented on a discussion on lib/system/sockets.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1489#note_744784412

>  system_writev(gnutls_transport_ptr_t ptr, const giovec_t * iovec,
>  	      int iovec_cnt)
>  {
> -	WSABUF bufs[iovec_cnt];
> +	WSABUF bufs_stack[16];
> +	WSABUF * bufs;
>  	DWORD bytes_sent;
>  	int to_send_cnt = 0;
>  	size_t to_send_bytes = 0;
> +	ssize_t ret;
> +
> +	if ((size_t)iovec_cnt > sizeof(bufs_stack) / sizeof(bufs_stack[0]))
> +	{
> +		bufs = (WSABUF *) malloc (iovec_cnt * sizeof(WSABUF));

Alternative version: https://gitlab.com/gnutls/gnutls/-/merge_requests/1490

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1489#note_744784412
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/20211126/ae2955e1/attachment-0001.html>


More information about the Gnutls-devel mailing list