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

Re: possible crash in svn_client_uuid_from_path

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2005-06-25 01:07:23 CEST

SteveKing <steveking@gmx.ch> writes:

> TSVN calls this function like this:
>
> svn_wc_adm_access_t *adm_access;
> SVN_ERR (svn_wc_adm_probe_open2 (&adm_access, NULL, target,
> FALSE, 0, pool));
> SVN_ERR (svn_client_uuid_from_path(UUID, target, adm_access,
> m_pctx, pool));
> SVN_ERR (svn_wc_adm_close (adm_access));
>
> with UUID being 'const char **' and target being a path to a local
> working copy in form 'const char *'.

Can you reproduce it? I'm thinking of fixing it as shown below but
the only way I can test it is by tweaking values in gdb when doing a
repo-to-wc copy.

Index: subversion/libsvn_client/ra.c
===================================================================
--- subversion/libsvn_client/ra.c (revision 15163)
+++ subversion/libsvn_client/ra.c (working copy)
@@ -349,11 +349,24 @@
     {
       *uuid = entry->uuid;
     }
- else
+ else if (entry->url)
     {
       /* fallback to using the network. */
       SVN_ERR (svn_client_uuid_from_url (uuid, entry->url, ctx, pool));
     }
+ else
+ {
+ /* try the parent if it's the same working copy */
+ svn_boolean_t is_root;
+ SVN_ERR (svn_wc_is_wc_root (&is_root, path, adm_access, pool));
+ if (is_root)
+ return svn_error_createf (SVN_ERR_ENTRY_MISSING_URL, NULL,
+ _("'%s' has no URL"),
+ svn_path_local_style (path, pool));
+ else
+ return svn_client_uuid_from_path (uuid, svn_path_dirname (path, pool),
+ adm_access, ctx, pool);
+ }
 
   return SVN_NO_ERROR;
 }

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Jun 25 01:08:43 2005

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