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

Re: svn commit: r1577144 - /subversion/trunk/subversion/libsvn_ra/compat.c

From: Branko Čibej <brane_at_wandisco.com>
Date: Thu, 13 Mar 2014 14:13:57 +0100

On 13.03.2014 13:53, ivan_at_apache.org wrote:
> Author: ivan
> Date: Thu Mar 13 12:53:40 2014
> New Revision: 1577144
>
> URL: http://svn.apache.org/r1577144
> Log:
> Fix problem exposed by r1577079.
>
> * subversion/libsvn_ra/compat.c
> (svn_ra__locations_from_log): Make a copy of constant apr_array_header_t
> argument before sorting it.

[...]

> @@ -337,10 +338,11 @@ svn_ra__locations_from_log(svn_ra_sessio
> /* Figure out the youngest and oldest revs (amongst the set of
> requested revisions + the peg revision) so we can avoid
> unnecessary log parsing. */
> - svn_sort__array(location_revisions, compare_revisions);
> - oldest_requested = APR_ARRAY_IDX(location_revisions, 0, svn_revnum_t);
> - youngest_requested = APR_ARRAY_IDX(location_revisions,
> - location_revisions->nelts - 1,
> + sorted_location_revisions = apr_array_copy(pool, location_revisions);
> + svn_sort__array(sorted_location_revisions, compare_revisions);
> + oldest_requested = APR_ARRAY_IDX(sorted_location_revisions, 0, svn_revnum_t);
> + youngest_requested = APR_ARRAY_IDX(sorted_location_revisions,
> + sorted_location_revisions->nelts - 1,
> svn_revnum_t);
> youngest = peg_revision;
> youngest = (oldest_requested > youngest) ? oldest_requested : youngest;
> @@ -352,7 +354,7 @@ svn_ra__locations_from_log(svn_ra_sessio
> /* Populate most of our log receiver baton structure. */
> lrb.kind = kind;
> lrb.last_path = fs_path;
> - lrb.location_revisions = apr_array_copy(pool, location_revisions);
> + lrb.location_revisions = apr_array_copy(pool, sorted_location_revisions);

So now you've copied the array twice?

-- Brane

-- 
Branko Čibej | Director of Subversion
WANdisco // Non-Stop Data
e. brane_at_wandisco.com
Received on 2014-03-13 14:14:35 CET

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.