You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2010/07/21 21:48:27 UTC
svn commit: r966383 - /subversion/trunk/subversion/svnrdump/svnrdump.c
Author: stsp
Date: Wed Jul 21 19:48:27 2010
New Revision: 966383
URL: http://svn.apache.org/viewvc?rev=966383&view=rev
Log:
Fix the following segfault in svnrdump ('session' is NULL):
#0 0x0388a87d in svn_ra_get_latest_revnum (session=0x0,
latest_revnum=0xcfbddbcc, pool=0x88ada018)
at subversion/libsvn_ra/ra_loader.c:586
586 return session->vtable->get_latest_revnum(session, latest_revnum, pool
);
There is another segfault still but let's fix them one at a time.
* subversion/svnrdump/svnrdump.c
(open_connection): Add a docstring. Make the SESSION parameter a pointer
to a pointer so the caller can actually get a useful result from us.
This used to work before r965418 when SESSION was still a global variable.
(main): Adjust caller.
Modified:
subversion/trunk/subversion/svnrdump/svnrdump.c
Modified: subversion/trunk/subversion/svnrdump/svnrdump.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnrdump/svnrdump.c?rev=966383&r1=966382&r2=966383&view=diff
==============================================================================
--- subversion/trunk/subversion/svnrdump/svnrdump.c (original)
+++ subversion/trunk/subversion/svnrdump/svnrdump.c Wed Jul 21 19:48:27 2010
@@ -94,8 +94,10 @@ replay_revend(svn_revnum_t revision,
return SVN_NO_ERROR;
}
+/* Return in *SESSION a new RA session to URL.
+ * Allocate *SESSION and related data structures in POOL. */
static svn_error_t *
-open_connection(svn_ra_session_t *session, const char *url, apr_pool_t *pool)
+open_connection(svn_ra_session_t **session, const char *url, apr_pool_t *pool)
{
svn_client_ctx_t *ctx = NULL;
SVN_ERR(svn_config_ensure (NULL, pool));
@@ -109,7 +111,7 @@ open_connection(svn_ra_session_t *sessio
NULL, NULL, NULL, FALSE,
FALSE, NULL, NULL, NULL,
pool));
- SVN_ERR(svn_client_open_ra_session(&session, url, ctx, pool));
+ SVN_ERR(svn_client_open_ra_session(session, url, ctx, pool));
return SVN_NO_ERROR;
}
@@ -191,7 +193,7 @@ main(int argc, const char **argv)
usage(stderr);
return EXIT_FAILURE;
}
- SVN_INT_ERR(open_connection(session, url, pool));
+ SVN_INT_ERR(open_connection(&session, url, pool));
/* Have sane start_revision and end_revision defaults if unspecified */
if (start_revision == svn_opt_revision_unspecified)