6712ef
6712ef
https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2014-3528
6712ef
6712ef
http://subversion.apache.org/security/CVE-2014-3528-advisory.txt
6712ef
6712ef
http://svn.apache.org/viewvc?view=revision&revision=r1615193
6712ef
6712ef
--- subversion-1.7.14/subversion/libsvn_subr/config_auth.c.cve3528
6712ef
+++ subversion-1.7.14/subversion/libsvn_subr/config_auth.c
6712ef
@@ -90,6 +90,7 @@ svn_config_read_auth_data(apr_hash_t **h
6712ef
   if (kind == svn_node_file)
6712ef
     {
6712ef
       svn_stream_t *stream;
6712ef
+      svn_string_t *stored_realm;
6712ef
 
6712ef
       SVN_ERR_W(svn_stream_open_readonly(&stream, auth_path, pool, pool),
6712ef
                 _("Unable to open auth file for reading"));
6712ef
@@ -100,6 +101,12 @@ svn_config_read_auth_data(apr_hash_t **h
6712ef
                 apr_psprintf(pool, _("Error parsing '%s'"),
6712ef
                              svn_dirent_local_style(auth_path, pool)));
6712ef
 
6712ef
+      stored_realm = apr_hash_get(*hash, SVN_CONFIG_REALMSTRING_KEY,
6712ef
+                                  APR_HASH_KEY_STRING);
6712ef
+
6712ef
+      if (!stored_realm || strcmp(stored_realm->data, realmstring) != 0)
6712ef
+        *hash = NULL; /* Hash collision, or somebody tampering with storage */
6712ef
+
6712ef
       SVN_ERR(svn_stream_close(stream));
6712ef
     }
6712ef