[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
Sat Feb 27 09:02:23 CET 2021




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

>  			    != 0)
>  				goto skip;
>  
> -			*chain =
> -			    gnutls_realloc_fast(*chain,
> -						sizeof((*chain)[0]) *
> -						++(*chain_len));
> +			*chain = _gnutls_reallocarray_fast(*chain,
> +							   ++(*chain_len),

I guess that's because we need to update `*chain_len` anyway here, while in other places we don't.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1392#note_518464570
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/20210227/8eb8228d/attachment.html>


More information about the Gnutls-devel mailing list