Matthew Selsky via devel <[email protected]>:
> On Mon, Mar 13, 2017 at 12:11:47PM -0700, Gary E. Miller wrote:
> > Yo Ertic!
> > 
> > 
> >     cp = buffer;
> >     cq = tag;
> > -   while (*cq != '\0')
> > +   while (*cq != '\0' && cp < buffer + sizeof(buffer) - 1)
> >             *cp++ = *cq++;
> > 
> > 
> > Why not just use strlcpy?  NTPsec has its own copy if the OS does
> > not provide it.  This sort of bit-picky C code is where problems lurk.
> 
> Hey Eric,
> 
> Was there an off-list answer to this?  Can we switch to strlcpy() for the 
> cases where we're copying null-terminated strings?

Sorry, was off for the weekend and missed this.

I agree with "This sort of bit-picky C code is where problems lurk" and I'd
have absolutely no objection to moving to strlcpy in cases  like this.
-- 
                <a href="http://www.catb.org/~esr/";>Eric S. Raymond</a>

Please consider contributing to my Patreon page at https://www.patreon.com/esr
so I can keep the invisible wheels of the Internet turning. Give generously -
the civilization you save might be your own.

_______________________________________________
devel mailing list
[email protected]
http://lists.ntpsec.org/mailman/listinfo/devel

Reply via email to