subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1664191 - /subversion/trunk/subversion/libsvn_subr/auth.c
Date Thu, 05 Mar 2015 00:53:51 GMT
Author: rhuijben
Date: Thu Mar  5 00:53:51 2015
New Revision: 1664191

URL: http://svn.apache.org/r1664191
Log:
* subversion/libsvn_subr/auth.c
  (svn_auth_first_credentials): Initialize parameters variable a bit
    earlier to avoid using it uninitialized in certain unlikely cases.

Modified:
    subversion/trunk/subversion/libsvn_subr/auth.c

Modified: subversion/trunk/subversion/libsvn_subr/auth.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/auth.c?rev=1664191&r1=1664190&r2=1664191&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/auth.c (original)
+++ subversion/trunk/subversion/libsvn_subr/auth.c Thu Mar  5 00:53:51 2015
@@ -253,6 +253,23 @@ svn_auth_first_credentials(void **creden
                              _("No provider registered for '%s' credentials"),
                              cred_kind);
 
+  if (auth_baton->slave_parameters)
+    {
+      apr_hash_index_t *hi;
+      parameters = apr_hash_overlay(pool, auth_baton->slave_parameters,
+                                    auth_baton->parameters);
+
+      for (hi = apr_hash_first(pool, auth_baton->slave_parameters);
+            hi;
+            hi = apr_hash_next(hi))
+        {
+          if (apr_hash_this_val(hi) == auth_NULL)
+            svn_hash_sets(parameters, apr_hash_this_key(hi), NULL);
+        }
+    }
+  else
+    parameters = auth_baton->parameters;
+
   /* First, see if we have cached creds in the auth_baton. */
   cache_key = make_cache_key(cred_kind, realmstring, pool);
   creds = svn_hash_gets(auth_baton->creds_cache, cache_key);
@@ -263,23 +280,6 @@ svn_auth_first_credentials(void **creden
   else
     /* If not, find a provider that can give "first" credentials. */
     {
-      if (auth_baton->slave_parameters)
-        {
-          apr_hash_index_t *hi;
-          parameters = apr_hash_overlay(pool, auth_baton->slave_parameters,
-                                        auth_baton->parameters);
-
-          for (hi = apr_hash_first(pool, auth_baton->slave_parameters);
-               hi;
-               hi = apr_hash_next(hi))
-            {
-              if (apr_hash_this_val(hi) == auth_NULL)
-                svn_hash_sets(parameters, apr_hash_this_key(hi), NULL);
-            }
-        }
-      else
-        parameters = auth_baton->parameters;
-
       /* Find a provider that can give "first" credentials. */
       for (i = 0; i < table->providers->nelts; i++)
         {



Mime
View raw message