Re: New procps release soon

"Dr. Werner Fink" <[email protected]> Mon, 30 Sep 2024 11:21:09 +0200
Newsgroups gmane.linux.procps.devel
Message-ID <[email protected]>
--DSd8fpYA/cl0T7xq
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2024/09/30 17:45:54 +1000, Craig Small wrote:
> On Wed, 25 Sept 2024 at 21:14, Dr. Werner Fink <[email protected]> wrote:
>=20
> >
> > I've got two patches from our glibc maintainer
> >
> >  procps-ng-4.0.4-idletime-no-tty.patch
> >  procps-ng-4.0.4-w-array-bounds.patch
> >
> Thanks Werner (and glibc maintainer),
>  They're now committed. Hadn't thought of the length of string
> sd_session_get_tty returns.
>=20
> One question though, won't that mean the destination string is not nul
> terminated if the source string is longer than UT_LINESIZE?
> It won't overwrite because it will break out of the for loop now, but
> wasn't sure if it would be terminated.

Indeed could be, maybe an initial
 memset(&tty[5], 0, UT_LINESIZE+1);
before the loop would be better as well as skipping the
 else
     tty[i + 5] =3D '\0';

but AFAICR the line above

    char [...] tty[5 + UT_LINESIZE + 1] =3D "/dev/";

does cause gcc to fill the all after /dev/ with \0

Werner

--=20
  "Having a smoking section in a restaurant is like having
          a peeing section in a swimming pool." -- Edward Burr

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

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

iQJfBAABCABKFiEEGwa/WjgpkPvLonW+UOkNVR3Bay4FAmb6bYEsFIAAAAAAFQAO
cGthLWFkZHJlc3NAZ251cGcub3Jnd2VybmVyQHN1c2UuZGUACgkQUOkNVR3Bay5D
vA/4xrlC4cCTemRodCF5hFsudLNAUaq8ukp37xQuS7R7mIc2xpR2KUUxPgnEsuXP
wJnM3bhNULHNqoSVdN8r4Mnznz13qjfnwmjwyNGicrO34WaaRl6tC522dKjHbM92
05EM/YZXwIEEKzLavYyaMhynfN7WMSTXUTOtqJkLzGfiPU7GmZw9oKHcurhZqigW
oe7Jkm0MRD6fYOJVEdhZey447zrf/z67er7OTKJ3cbw2WILiwa1Vjzx3l4AMO4Tu
1acMP5LYeY9zT463yuangdwTlaqLRQ+2rJrFrYsMYUOBYnjrbsK4eXTiLcvkIHbn
5sGnWdA0H8Cuco4PhQWeq14HkKfkQreH5YuPHxxVe8dtwx5WUDFHySY6hiVIowKz
reIPIMaQVtRj93yPQDbgkZbRRls9UCs5E8TyMcPs4eMhug6fw91/r1tscX6/HKFB
ZOi27YnB8R1WOOwH53q3CX40MyO8EB7cp4ZqD7eWkegT3RlVJLbTpHrhChFtp87I
bBZEytLAuwzbp1QhsOgdoc1yJFVS+MocQ6Ie35NTxL+ageiY+LwY/6Z844AJC2ax
Z3EO+Jqt1O6sZZKzxFVZOkOHnqButbUoKUod6+on4qBs8MX7Jprqstfz6+zXQdK8
s2ekvKsvcIQirji/FkOBv1xSSqGOdBqNsrGO9WauWM70pw==
=DikC
-----END PGP SIGNATURE-----

--DSd8fpYA/cl0T7xq--