subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kot...@apache.org
Subject svn commit: r1766089 - /subversion/trunk/subversion/libsvn_ra_serf/serf.c
Date Fri, 21 Oct 2016 17:52:43 GMT
Author: kotkov
Date: Fri Oct 21 17:52:42 2016
New Revision: 1766089

URL: http://svn.apache.org/viewvc?rev=1766089&view=rev
Log:
Don't segfault in ra_serf_dup_session() when duplicating a session
without a discovered repository root.

This fixes a crash in conflicts-tests when running over HTTP v1 protocol.

* subversion/libsvn_ra_serf/serf.c
  (ra_serf_dup_session): Check "repos_root_str" against null before
   attempting to parse it.

Modified:
    subversion/trunk/subversion/libsvn_ra_serf/serf.c

Modified: subversion/trunk/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/serf.c?rev=1766089&r1=1766088&r2=1766089&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/serf.c Fri Oct 21 17:52:42 2016
@@ -734,11 +734,14 @@ ra_serf_dup_session(svn_ra_session_t *ne
     new_sess->server_allows_bulk = apr_pstrdup(result_pool,
                                                new_sess->server_allows_bulk);
 
-  new_sess->repos_root_str = apr_pstrdup(result_pool,
-                                         new_sess->repos_root_str);
-  SVN_ERR(svn_ra_serf__uri_parse(&new_sess->repos_root,
-                                 new_sess->repos_root_str,
-                                 result_pool));
+  if (new_sess->repos_root_str)
+    {
+      new_sess->repos_root_str = apr_pstrdup(result_pool,
+                                             new_sess->repos_root_str);
+      SVN_ERR(svn_ra_serf__uri_parse(&new_sess->repos_root,
+                                     new_sess->repos_root_str,
+                                     result_pool));
+    }
 
   new_sess->session_url_str = apr_pstrdup(result_pool, new_session_url);
 



Mime
View raw message