svn commit: r367701 - head/lib/libutil

Scott Long scottl at samsco.org
Sun Nov 15 19:06:25 UTC 2020


> On Nov 15, 2020, at 12:01 PM, Jessica Clarke <jrtc27 at freebsd.org> wrote:
>> 
>> 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’ll
>> look at it some more.
> 
> 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.
> 

Yep, I wasn’t happy with ENOMEM either but I couldn’t 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.
> 

Done.

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

https://reviews.freebsd.org/D27227

Thanks,
Scott



More information about the svn-src-all mailing list