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

Re: r27729 breaks API of svn_ra_get_log2

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: Tue, 27 May 2008 10:34:05 -0400

Martin von Gagern wrote:
> Hi!
>
> I haven't seen this in real life yet, but I believe r27737 introduced an
> inconsistency with the API spec. Accoding to svn_ra.h, the paths
> parameter of svn_ra_get_log2 may be NULL, but as of that patch, the
> implementation in ra_loader.c dereferences paths in paths->nelts without
> checking for NULL first.
>
> Do you agree this is a bug?

Yes. (An oversight on my part.)

> Would you like to see this in the issue tracker?

Not if the following patch fixes it.

Index: subversion/libsvn_ra/ra_loader.c
===================================================================
--- subversion/libsvn_ra/ra_loader.c (revision 31465)
+++ subversion/libsvn_ra/ra_loader.c (working copy)
@@ -1023,7 +1023,7 @@
                               apr_pool_t *pool)
  {
    int i;
- for (i = 0; i < paths->nelts; i++)
+ for (i = 0; paths && (i < paths->nelts); i++)
      {
        const char *path = APR_ARRAY_IDX(paths, i, const char *);
        assert(*path != '/');

-- 
C. Michael Pilato <cmpilato_at_collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

Received on 2008-05-27 16:34:22 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.