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

svnsync fails with segmentation fault trying to normalize a null string

From: Alexander Sinyushkin <Alexander.Sinyushkin_at_svnkit.com>
Date: Fri, 05 Jun 2009 14:34:41 +0200

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,
       *str = svn_string_create(cstring, pool);
       *was_normalized = TRUE;

   return SVN_NO_ERROR;

Alexander Sinyushkin,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!
Received on 2009-06-05 14:34:58 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.