svn commit: r314778 - head/lib/libfetch

Baptiste Daroussin bapt at FreeBSD.org
Mon Mar 6 15:44:21 UTC 2017


On Mon, Mar 06, 2017 at 03:38:03PM +0000, Pedro F. Giffuni wrote:
> Author: pfg
> Date: Mon Mar  6 15:38:03 2017
> New Revision: 314778
> URL: https://svnweb.freebsd.org/changeset/base/314778
> 
> Log:
>   libfetch: extra bounds checking through reallocarray(3).
>   
>   Reviewed by:	des
>   MFC after:	1 week
> 
> Modified:
>   head/lib/libfetch/common.c
> 
> Modified: head/lib/libfetch/common.c
> ==============================================================================
> --- head/lib/libfetch/common.c	Mon Mar  6 15:37:34 2017	(r314777)
> +++ head/lib/libfetch/common.c	Mon Mar  6 15:38:03 2017	(r314778)
> @@ -1306,7 +1306,7 @@ fetch_add_entry(struct url_ent **p, int 
>  	}
>  
>  	if (*len >= *size - 1) {
> -		tmp = realloc(*p, (*size * 2 + 1) * sizeof(**p));
> +		tmp = reallocarray(*p, *size * 2 + 1, sizeof(**p));

It reduces portability of libfetch (which pkg depends on) I can probably add an
implementation of reallocarry in pkg itself.

Best regards,
Bapt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20170306/7e43bec9/attachment.sig>


More information about the svn-src-head mailing list