[gnutls-devel] GnuTLS | build: avoid potential integer overflow in array allocation (!1392)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Thu Feb 25 07:16:34 CET 2021




Daiki Ueno commented on a discussion on lib/x509/crl.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1392#note_516788186

>  	    gnutls_x509_crl_list_import(*crls, &init, data, format,
>  					flags | GNUTLS_X509_CRT_LIST_IMPORT_FAIL_IF_EXCEED);
>  	if (ret == GNUTLS_E_SHORT_MEMORY_BUFFER) {
> -		*crls =
> -		    gnutls_realloc_fast(*crls,
> -					sizeof(gnutls_x509_crl_t) * init);
> +		*crls = _gnutls_reallocarray_fast(*crls, init,

In this specific case, line 1265 is the first time where `*crls` is allocated so there is no need for freeing anything.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1392#note_516788186
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/20210225/48e9c6e0/attachment.html>


More information about the Gnutls-devel mailing list