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

RE: [PATCH] ra_serf:commit.c: add missing strdup

From: Bert Huijben <bert_at_qqmail.nl>
Date: Sat, 28 Dec 2013 00:45:39 +0100

                Roman,

 

The add_directory() function had a similar problem, so if you apply a
workaround you might want to do that there too.

 

I nominated the fixes for backport to 1.8.x.

 

 

Thanks for your detailed bug report!

 

                Bert

 

From: Stefan Fuhrmann [mailto:stefan.fuhrmann_at_wandisco.com]
Sent: woensdag 25 december 2013 13:55
To: Roman Kagan
Cc: Subversion Development
Subject: Re: [PATCH] ra_serf:commit.c: add missing strdup

 

On Tue, Dec 24, 2013 at 11:18 PM, Roman Kagan <rkagan_at_mail.ru
<mailto:rkagan_at_mail.ru> > wrote:

The file context created in add_file() is supposed to survive beyond the
end of function, so it needs its own copy of copy_path.

The failure scenario was observed in git-svn usage, with errors like

perl: subversion/libsvn_subr/dirent_uri.c:2489: svn_fspath__skip_ancestor:
Assertion `svn_fspath__is_canonical(child_fspath)' failed.

See e.g.
http://stackoverflow.com/questions/17693255/git-svn-dcommit-fails-because-of
-assertion-error-svn-fspath-is-canonicalchild
or
http://git.661346.n2.nabble.com/Fwd-Error-with-git-svn-pushing-a-rename-tt75
99382.html

The second link also includes my analysis and a workaround for git-svn
at
http://git.661346.n2.nabble.com/Fwd-Error-with-git-svn-pushing-a-rename-tt75
99382.html#a7601204

Index: subversion/libsvn_ra_serf/commit.c
===================================================================
--- subversion/libsvn_ra_serf/commit.c (revision 1553332)
+++ subversion/libsvn_ra_serf/commit.c (working copy)
@@ -1872,7 +1872,7 @@ add_file(const char *path,
   new_file->name = svn_relpath_basename(new_file->relpath, NULL);
   new_file->added = TRUE;
   new_file->base_revision = SVN_INVALID_REVNUM;
- new_file->copy_path = copy_path;
+ new_file->copy_path = apr_pstrdup(new_file->pool, copy_path);
   new_file->copy_revision = copy_revision;
   new_file->changed_props = apr_hash_make(new_file->pool);
   new_file->removed_props = apr_hash_make(new_file->pool);

 

Thanks for the patch! Committed as r1553376.

-- Stefan^2.
Received on 2013-12-28 00:46:28 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.