[gnutls-devel] GnuTLS | Remove unbounded uses of alloca in the Guile bindings (!1022)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Fri Jun 7 10:53:24 CEST 2019



Merge request https://gitlab.com/gnutls/gnutls/merge_requests/1022 was reviewed by Tim Rühsen

--
  
Tim Rühsen started a new discussion on guile/src/core.c: https://gitlab.com/gnutls/gnutls/merge_requests/1022#note_178895374

> +#define FAST_ALLOC(size)					\
> +  (((size) <= ALLOCA_MAX_SIZE)					\
> +   ? alloca (size)						\

Thanks for working on this !

It would be nice to not use alloca() at all. It's not trivially portable and someone recently had issues on Solaris 11.3.

What about using C89 local arrays (size of 256 for paths seems to be enough) like e.g. `char c_file_buf[256];` and then amending your macro to result in something like
```
c_file = size <= sizeof(c_file_buf) ? c_file_buf : scm_gc_malloc_pointerless(...)
```
?


-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/merge_requests/1022
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/20190607/3786b200/attachment.html>


More information about the Gnutls-devel mailing list