subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svn-r...@apache.org
Subject svn commit: r1454652 - in /subversion/branches/1.7.x: ./ STATUS subversion/mod_dav_svn/mirror.c
Date Sat, 09 Mar 2013 04:05:28 GMT
Author: svn-role
Date: Sat Mar  9 04:05:28 2013
New Revision: 1454652

URL: http://svn.apache.org/r1454652
Log:
Merge r1421380 from trunk:

 * r1421380
   Issue #4272: s/assertion/error/ in the DAV proxy code.
   Justification:
     The assertion has been run into in the wild
   Votes:
     +1: danielsh, rhuijben, philip

Modified:
    subversion/branches/1.7.x/   (props changed)
    subversion/branches/1.7.x/STATUS
    subversion/branches/1.7.x/subversion/mod_dav_svn/mirror.c

Propchange: subversion/branches/1.7.x/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1421380

Modified: subversion/branches/1.7.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/STATUS?rev=1454652&r1=1454651&r2=1454652&view=diff
==============================================================================
--- subversion/branches/1.7.x/STATUS (original)
+++ subversion/branches/1.7.x/STATUS Sat Mar  9 04:05:28 2013
@@ -305,10 +305,3 @@ Veto-blocked changes:
 
 Approved changes:
 =================
-
- * r1421380
-   Issue #4272: s/assertion/error/ in the DAV proxy code.
-   Justification:
-     The assertion has been run into in the wild
-   Votes:
-     +1: danielsh, rhuijben, philip

Modified: subversion/branches/1.7.x/subversion/mod_dav_svn/mirror.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/mod_dav_svn/mirror.c?rev=1454652&r1=1454651&r2=1454652&view=diff
==============================================================================
--- subversion/branches/1.7.x/subversion/mod_dav_svn/mirror.c (original)
+++ subversion/branches/1.7.x/subversion/mod_dav_svn/mirror.c Sat Mar  9 04:05:28 2013
@@ -39,12 +39,17 @@
    URI_SEGMENT is the URI bits relative to the repository root (but if
    non-empty, *does* have a leading slash delimiter).
    MASTER_URI and URI_SEGMENT are not URI-encoded. */
-static void proxy_request_fixup(request_rec *r,
-                                const char *master_uri,
-                                const char *uri_segment)
+static int proxy_request_fixup(request_rec *r,
+                               const char *master_uri,
+                               const char *uri_segment)
 {
-    assert((uri_segment[0] == '\0')
-           || (uri_segment[0] == '/'));
+    if (uri_segment[0] != '\0' && uri_segment[0] != '/')
+      {
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, SVN_ERR_BAD_CONFIG_VALUE, r,
+                     "Invalid URI segment '%s' in slave fixup",
+                      uri_segment);
+        return HTTP_INTERNAL_SERVER_ERROR;
+      }
 
     r->proxyreq = PROXYREQ_REVERSE;
     r->uri = r->unparsed_uri;
@@ -57,6 +62,7 @@ static void proxy_request_fixup(request_
     ap_add_output_filter("LocationRewrite", NULL, r, r->connection);
     ap_add_output_filter("ReposRewrite", NULL, r, r->connection);
     ap_add_input_filter("IncomingRewrite", NULL, r, r->connection);
+    return OK;
 }
 
 
@@ -91,8 +97,10 @@ int dav_svn__proxy_request_fixup(request
                                                     "/txn/", (char *)NULL))
                     || ap_strstr_c(seg, apr_pstrcat(r->pool, special_uri,
                                                     "/txr/", (char *)NULL))) {
+                    int rv;
                     seg += strlen(root_dir);
-                    proxy_request_fixup(r, master_uri, seg);
+                    rv = proxy_request_fixup(r, master_uri, seg);
+                    if (rv) return rv;
                 }
             }
             return OK;
@@ -106,8 +114,10 @@ int dav_svn__proxy_request_fixup(request
                     r->method_number == M_LOCK ||
                     r->method_number == M_UNLOCK ||
                     ap_strstr_c(seg, special_uri))) {
+            int rv;
             seg += strlen(root_dir);
-            proxy_request_fixup(r, master_uri, seg);
+            rv = proxy_request_fixup(r, master_uri, seg);
+            if (rv) return rv;
             return OK;
         }
     }



Mime
View raw message