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

Re: svnsync fails with segmentation fault trying to normalize a null string

From: Mark Phippard <markphip_at_gmail.com>
Date: Fri, 5 Jun 2009 08:54:36 -0400

I believe this change to normalize the strings has gone into 1.6.3.
So perhaps we should get a fix for this in place before we roll the
release?

Mark

On Fri, Jun 5, 2009 at 8:34 AM, Alexander
Sinyushkin<Alexander.Sinyushkin_at_svnkit.com> wrote:
> Hello community,
>
> While syncing a repository where svn:eol-style was first set on a file
> and then removed in a subsequent revision I got a segmentation fault. As
> a result, svnsync can not synchronize the revision where the deletion of
> an svn:* property took place.
>
> When change_file_prop() is called for the file in question
> the property value is passed as null, I suppose.
> This value is passed then to normalize_string() which does not check the
> str parameter for null in its if clause:
>
> static svn_error_t*
> normalize_string(const svn_string_t **str,
>                  svn_boolean_t *was_normalized,
>                  apr_pool_t *pool)
> {
>   *was_normalized = FALSE;
>
>   /* Detect inconsistent line ending style simply by looking
>      for carriage return (\r) characters. */
>   if (strchr((*str)->data, '\r') != NULL)
>     {
>       /* Found some. Normalize. */
>       const char* cstring = NULL;
>       SVN_ERR(svn_subst_translate_cstring2((*str)->data, &cstring,
>                                            "\n", TRUE,
>                                            NULL, FALSE,
>                                            pool));
>       *str = svn_string_create(cstring, pool);
>       *was_normalized = TRUE;
>     }
>
>   return SVN_NO_ERROR;
> }
>
>
> ----
> Alexander Sinyushkin,
> TMate Software,
> http://svnkit.com/ - Java [Sub]Versioning Library!
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2359689
>

-- 
Thanks
Mark Phippard
http://markphip.blogspot.com/
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2359699
Received on 2009-06-05 14:55:09 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.