Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Mar 2017 16:44:19 +0100
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        "Pedro F. Giffuni" <pfg@FreeBSD.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r314778 - head/lib/libfetch
Message-ID:  <20170306154419.psguuxspco3hgw64@ivaldir.net>
In-Reply-To: <201703061538.v26Fc33J022910@repo.freebsd.org>
References:  <201703061538.v26Fc33J022910@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--rtulrpcuyuuqcf2s
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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
>=20
> Log:
>   libfetch: extra bounds checking through reallocarray(3).
>  =20
>   Reviewed by:	des
>   MFC after:	1 week
>=20
> Modified:
>   head/lib/libfetch/common.c
>=20
> Modified: head/lib/libfetch/common.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- 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=20
>  	}
> =20
>  	if (*len >=3D *size - 1) {
> -		tmp =3D realloc(*p, (*size * 2 + 1) * sizeof(**p));
> +		tmp =3D reallocarray(*p, *size * 2 + 1, sizeof(**p));

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

Best regards,
Bapt

--rtulrpcuyuuqcf2s
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAli9g9MACgkQY4mL3PG3
PlpuSBAA5iAxiI3TVgOf/7KDRNmJ+sUFfeMw/dd2cqcicTRhHXLFI8hwl20xZjz+
agsMoDEUidFi2IiD1qKk1BsWrO84EB527QgTkNk11NOS65dbd40yPqAvEbsQ+nu5
vkOmXxXHTh3CAjH+ILxzJ61KrDj5NcEmcGownHS4UhUEosk6iQhagrddU2ib6YuU
LPXim/Itp6SK5t1VGT1xTQRdOX+OMA2y/MujaH68JKpcXjlLn+/ATADMgo/2Or67
ZEtoNFdTE72E+FRcDxB3fOBkQ1R1mUtWGydFYnFRQsJ17aT2ZaNbAmoky4DGXpGZ
tNI4nh/R2LUS8PLQVYU++ar3Z6MMwvmA6hDKa1tia/++zmIcLzuAZIon58PffU7R
IhicYnGI0yp4QAen396cgsk/tYWrOuhDFQnYoipIr68lueT4fR/TZ77uGNNr0SJn
rZBjbeX9B/Kl1ohZ5GrwdQfqRId0PeyI6SzNVekQevmKbghLyF/8n1qZJ3nPw3IK
vCZ18EATyH6RCYv7S8SiHY76LCD63dWphfWoYTDJW2HVG0OYIOybK5Y0xZ9heRB/
PFzT0tU57EEikgilwm+tSm9P/R+vxTLVHrpylK+Tl8N+L6S6zkLKStWRJ4Qe9IO6
yWR6mO4oIDmxRXRmEeDxFc4q0Ollv7kIA3JCaPLaskUdPvFyqnw=
=63qX
-----END PGP SIGNATURE-----

--rtulrpcuyuuqcf2s--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170306154419.psguuxspco3hgw64>