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

Re: svn commit: r10143 - in trunk/subversion: libsvn_subr tests/libsvn_subr

From: Josh Pieper <jjp_at_pobox.com>
Date: 2004-07-05 17:50:48 CEST

Greg Hudson wrote:
> On Mon, 2004-07-05 at 09:06, jpieper@tigris.org wrote:
> > - while (path->len > 0 && path->data[path->len - 1] != '/')
> > + while (path->len > 0 && path->data[path->len] != '/')
> > --path->len;
> > +
> > + if (path->len == 0 && path->data[0] == '/')
> > + path->len++;
>
> The valid indices of path->data range from 0 to path->len - 1. Your new
> code starts accessing path->data[path->len] right off the bat, which is
> invalid, and then accesses path->data[0] at the end if path->len is 0,
> which is also invalid if path->len was 0 to start with.

I though svn_stringbuf_t maintained the invariant that
path->data[path->len] == '\0'?

-Josh

-- 
To be is to be related.
		-- C.J. Keyser.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Jul 5 17:51:57 2004

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.