[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: CVS update: MODIFIED: libsvn_ra_dav ...

From: Greg Stein <gstein_at_lyra.org>
Date: 2001-08-14 23:19:51 CEST

On Tue, Aug 14, 2001 at 11:06:28AM -0500, kfogel@collab.net wrote:
> gstein@tigris.org writes:
> > +
> > + /* use custom prefix for anything that doesn't start with "svn:" */
> > + if (strncmp(name, "svn:", 4) == 0)
> > + ne_buffer_concat(body, "<S:", name + 4, ">", value, "</S:", name + 4, ">",
> > + NULL);
> > + else
> > + ne_buffer_concat(body, "<C:", name, ">", value, "</C:", name, ">", NULL);
> > +
> > return 1;
> > }
>
> Greg, should we worry about the case where name < 4 bytes long? It
> seems to me the strncmp() might run off the end, then.

memcmp() does an exact amount.

strncmp() does "at most" N characters. It will terminate if '\0' is reached
beforehand.

And yes, I'm worried about a name such as "hi" when somebody goes to test
the thing out.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:36 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.