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

Re: log-report without path breaks compatibility

From: Mark Phippard <markphip_at_gmail.com>
Date: Tue, 3 Jun 2008 10:57:13 -0400

On Tue, Jun 3, 2008 at 10:50 AM, Martin von Gagern
<Martin.vGagern_at_gmx.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Mark Phippard wrote:
> | This was reported a week or so ago and the fix is included in the just
> | released RC8.
>
> Is that so? I can find neither code nor commits for this, and my network
> traffic with trunk or RC8 still shows this issue, i.e. svn_ra_get_log2
> returns an empty log when called with a NULL argument.

This is the revision I am thinking of from the 1.5.x branch:

r31481 | hwright | 2008-05-27 16:54:03 -0400 (Tue, 27 May 2008) | 11 lines

Merge r31468, r31470 from trunk:

 * r31468, r31470
   Don't attempt to iterate over NULL arrays (which are explicitly
   allowed per the docstrings of the affected functions).
   Notes:
     Obvious fix? Can probably wait for 1.5.1, but is known to effect
     some third-party API consumers.
   Votes:
     +1: cmpilato, glasser, epg

And this is the diff:

Index: subversion/libsvn_ra/ra_loader.c
===================================================================
--- subversion/libsvn_ra/ra_loader.c (revision 31480)
+++ subversion/libsvn_ra/ra_loader.c (revision 31481)
@@ -931,11 +931,14 @@ svn_error_t *svn_ra_get_log2(svn_ra_session_t *ses
                              void *receiver_baton,
                              apr_pool_t *pool)
 {
- int i;
- for (i = 0; i < paths->nelts; i++)
+ if (paths)
     {
- const char *path = APR_ARRAY_IDX(paths, i, const char *);
- assert(*path != '/');
+ int i;
+ for (i = 0; i < paths->nelts; i++)
+ {
+ const char *path = APR_ARRAY_IDX(paths, i, const char *);
+ assert(*path != '/');
+ }
     }

   if (include_merged_revisions)
@@ -960,12 +963,15 @@ svn_error_t *svn_ra_get_log(svn_ra_session_t *sess
 {
   svn_log_entry_receiver_t receiver2;
   void *receiver2_baton;
- int i;

- for (i = 0; i < paths->nelts; i++)
+ if (paths)
     {
- const char *path = APR_ARRAY_IDX(paths, i, const char *);
- assert(*path != '/');
+ int i;
+ for (i = 0; i < paths->nelts; i++)
+ {
+ const char *path = APR_ARRAY_IDX(paths, i, const char *);
+ assert(*path != '/');
+ }
     }

   svn_compat_wrap_log_receiver(&receiver2, &receiver2_baton,

-- 
Thanks
Mark Phippard
http://markphip.blogspot.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-06-03 16:57:47 CEST

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.