Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Nov 2019 07:15:30 -0800
From:      David Wolfskill <david@catwhisker.org>
To:        Arnaud Ysmal <a@stacktic.org>
Cc:        freebsd-current@freebsd.org
Subject:   Re: Segmentation fault in netstat after r354373 -> r354373 update
Message-ID:  <20191107151530.GU1194@albert.catwhisker.org>
In-Reply-To: <cc5c473e58f7b727e056fad14670d823@stacktic.org>
References:  <cc5c473e58f7b727e056fad14670d823@stacktic.org>

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

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

On Thu, Nov 07, 2019 at 04:08:28PM +0100, Arnaud Ysmal wrote:
> Hi,
>=20
> I just got the same issue, it happens when argv[0] does not contain a /=
=20
> (calling uptime segfault but calling /usr/bin/uptime works).
>=20
> In xo_parse_args there is no check whether cp is NULL before calling=20
> xo_streq.
>=20
> I fixed it by changing this line:
> -       cp =3D &cp[len + 1 - sizeof(gnu_ext)];
> +       cp =3D (char *)(uintptr_t)(const char *)(&xo_program[len + 1 -=20
> sizeof(gnu_ext)]);
>=20
> Arnaud Ysmal

Ah!  Excellent analysis: thank you! :-)

Peace,
david

--=20
David H. Wolfskill				david@catwhisker.org
It's ... rich ... for Trump to accuse someone else of being a liar.

See http://www.catwhisker.org/~david/publickey.gpg for my public key.

--Z7anUBlSj09l+zDK
Content-Type: application/pgp-signature; name="signature.asc"

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

iQGTBAEBCgB9FiEE4owz2QxMJyaxAefyQLJg+bY2PckFAl3ENRJfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEUy
OEMzM0Q5MEM0QzI3MjZCMTAxRTdGMjQwQjI2MEY5QjYzNjNEQzkACgkQQLJg+bY2
PcnzHAgAqTAQosIcyxn6JT1qehvtF544V2yQOwVI6+0r8sQvUlnHWAsjh6re36+O
uQzqchccMyxZxsWqNjactV/N4YILHOO4mGW9B+AUAs4cl6EwQbgLZu8G0L1pTQhw
Xqgrqp15oiqwFcLiUuWrIt6X9q7TbmdCkb1D1tvjZ/s3rTfK266vZDA2JHqJ254c
2ACKJRsy7dRxfgA5A8I3tLh3OdyX4EbpdKrkfgrB7YBOyJM+tRKb8bxS7rmTpx9W
XNseX0k/aeuUFmRNthUHVDWSuKHfBFyCAezMui6hPgBiRCew/LAuiznVdEQCxnwF
ZZyi5kp4H/qp+Gj7q4UzPM4iKgyrNA==
=S2bj
-----END PGP SIGNATURE-----

--Z7anUBlSj09l+zDK--



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