Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Apr 2022 20:20:11 -0400
From:      Shawn Webb <shawn.webb@hardenedbsd.org>
To:        "Alfonso S. Siciliano" <asiciliano@FreeBSD.org>
Cc:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   Re: git: 9b4c606b96ce - main - bsdinstall/partedit: Fix UFS auto partitioning
Message-ID:  <20220430002011.4zpqn3l4c3wsc3vm@mutt-hbsd>
In-Reply-To: <202204292324.23TNOusA058900@gitrepo.freebsd.org>
References:  <202204292324.23TNOusA058900@gitrepo.freebsd.org>

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

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

On Fri, Apr 29, 2022 at 11:24:56PM +0000, Alfonso S. Siciliano wrote:
> The branch main has been updated by asiciliano:
>=20
> URL: https://cgit.FreeBSD.org/src/commit/?id=3D9b4c606b96ce8a8b011dc50295=
c71c38741a0f4f
>=20
> commit 9b4c606b96ce8a8b011dc50295c71c38741a0f4f
> Author:     Alfonso S. Siciliano <asiciliano@FreeBSD.org>
> AuthorDate: 2022-04-29 23:19:30 +0000
> Commit:     Alfonso S. Siciliano <asiciliano@FreeBSD.org>
> CommitDate: 2022-04-29 23:24:23 +0000
>=20
>     bsdinstall/partedit: Fix UFS auto partitioning
>    =20
>     Fix bsdinstall "Auto (UFS) Guided Disk Setup" and sade(8) "Auto".
>     The problem is a string comparison failure, it arose during the
>     dialog(3)/bsddialog(3) form conversion:
>    =20
>      * dialog uses only form.text while bsdialog differentiates between
>        form.init and form.value.
>      * dialog always allocates memory for form values while bsddialog only
>        when a button is pressed.
>    =20
>     Reviewed by:            bapt
>     Differential Revision:  https://reviews.freebsd.org/D35033
> ---
>  usr.sbin/bsdinstall/partedit/gpart_ops.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>=20
> diff --git a/usr.sbin/bsdinstall/partedit/gpart_ops.c b/usr.sbin/bsdinsta=
ll/partedit/gpart_ops.c
> index 65cda247e146..26aedb58ef39 100644
> --- a/usr.sbin/bsdinstall/partedit/gpart_ops.c
> +++ b/usr.sbin/bsdinstall/partedit/gpart_ops.c
> @@ -1154,6 +1154,12 @@ addpartform:
>  			init_allocated =3D true;
>  			goto addpartform;
>  		}
> +	} else { /* auto partitioning */
> +		items[0].value =3D strdup(items[0].init);
> +		items[1].value =3D strdup(items[1].init);
> +		items[2].value =3D strdup(items[2].init);
> +		if (nitems > 3)
> +			items[3].value =3D strdup(items[3].init);
>  	}
> =20
>  	/*
>=20

Hey Alfonso,

Would it be a good idea to check the return value of strdup in this
particular case?

Thanks,

--=20
Shawn Webb
Cofounder / Security Engineer
HardenedBSD

https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A=
4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc

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

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

iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmJsgLgACgkQ/y5nonf4
4fo2Tg//bS5JdhP2D3KqBTEAxL6I6zezVgsEWy1eyxMWqthms8ysj+RzmsQDn9iz
qnCuZuhG9W8l2/RrdMgGTmhRKrOh26S0dCSPh9E6sMGtxNxwos+F4mEiS+4t/RnI
YHN9XenHh2jAGYD7khqRZHsNb5ZXJgi7DvYfPsrSReOHkdHvtfwQGNce2kYp7rqR
42/Uz1kSCSp/HWWFNoCgm9bx7LQTRy2ZaIQxCC3eXXKKv1KiQ4Gdi6XwJiCoxfKe
froDACNEHSKY3OwkU6ao6hDy+JIOQvke3dpjlOXurg9MGEs2kLWfkN7qwtS39lUk
OMrM/Qppk4nIhzevKHWVyWrJF6EJe9jwqNn8IOJfILnsnmfn/dmHCSNZLFvl/Rnr
d4QPj0I0lFaUyXa4B4qVHuFLwrZt9y7CCcg/QouebLKpahf0vH0UibYfze5Q06pt
ZVxAU+YWEMhmY2SX5UMNzt2z4pMBfCLK4kGN9qi8+3LXgG0YMKYuO2nWCKmn+Ibc
WGb8CTP4EZC1dcQYgDxJkB3YOp+8iqXfVdUCZKXAbRFdNvuIQgOnByJQkUuWUDe3
6tH0058iUmD4otTpbwxbIji5KVKdQJflaH++ZjyQlz+++CdOhASegu0wCRGJjz+T
T+eO6aVpW29nzBgbY6AcPxT4jWqKtUh1vye4WEOx1MM6KhQdR5M=
=ExHK
-----END PGP SIGNATURE-----

--fo5zonow3jpjyww7--



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