Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Nov 2020 12:06:22 -0700
From:      Scott Long <scottl@samsco.org>
To:        Jessica Clarke <jrtc27@freebsd.org>
Cc:        Scott Long <scottl@FreeBSD.org>, src-committers <src-committers@freebsd.org>, svn-src-all <svn-src-all@freebsd.org>, svn-src-head <svn-src-head@freebsd.org>
Subject:   Re: svn commit: r367701 - head/lib/libutil
Message-ID:  <EBD050A5-70AE-43E8-A9E1-CCD3BCA11180@samsco.org>
In-Reply-To: <329C4753-BB97-4C67-8CDA-39EB67E16CE8@freebsd.org>
References:  <202011150748.0AF7mqW3016900@repo.freebsd.org> <D5492BB4-A282-4E35-B02F-1216769FDA51@freebsd.org> <A39C12CC-D3D6-4166-9089-7466FA1C2B2D@samsco.org> <329C4753-BB97-4C67-8CDA-39EB67E16CE8@freebsd.org>

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

> On Nov 15, 2020, at 12:01 PM, Jessica Clarke <jrtc27@freebsd.org> =
wrote:
>>=20
>> I felt similar concerns, but my misunderstanding of strlcpy() drove =
the
>> result.  Since the use case for getlocalbase() lends itself to also =
use
>> strlcat()/strlcpy(), I was trying to replicate the API semantics of =
those,
>> at least to the limit of my understanding.  Thanks for the feedback, =
I=E2=80=99ll
>> look at it some more.
>=20
> Thanks. ENOMEM also feels inappropriate as no allocation is taking
> place. Perhaps ENAMETOOLONG, which is used in similar cases for things
> like gethostbyname? Though sysctlbyname uses ENOMEM instead... sigh.
>=20

Yep, I wasn=E2=80=99t happy with ENOMEM either but I couldn=E2=80=99t =
find anything better.

> Also, if pathlen has already been checked against SSIZE_MAX (giving
> EINVAL) and tmplen against pathlen there's no need to then check =
tmplen
> against SSIZE_MAX.
>=20

Done.

> I'd be happy to give a review on Phabricator if/when you have a new
> patch.
>=20

https://reviews.freebsd.org/D27227

Thanks,
Scott




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?EBD050A5-70AE-43E8-A9E1-CCD3BCA11180>