[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: Greg Hudson <ghudson_at_MIT.EDU>
Date: 2004-07-05 17:23:31 CEST

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.

---------------------------------------------------------------------
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:25:22 2004

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