subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1166555 - /subversion/trunk/subversion/libsvn_ra_svn/cyrus_auth.c
Date Thu, 08 Sep 2011 08:05:01 GMT
Author: stsp
Date: Thu Sep  8 08:05:00 2011
New Revision: 1166555

URL: http://svn.apache.org/viewvc?rev=1166555&view=rev
Log:
Fix a possible crash in ra_svn if SASL authentication is active.

* subversion/libsvn_ra_svn/cyrus_auth.c
  (svn_ra_svn__do_cyrus_auth): Give the auth callbacks sufficient
   lifetime to survive until connection pool cleanup. CyrusSASL
   needs the callbacks in the cleanup handler of this pool.
   
Found by: Dave Huang <khym@azeotrope.org>

Modified:
    subversion/trunk/subversion/libsvn_ra_svn/cyrus_auth.c

Modified: subversion/trunk/subversion/libsvn_ra_svn/cyrus_auth.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_svn/cyrus_auth.c?rev=1166555&r1=1166554&r2=1166555&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_svn/cyrus_auth.c (original)
+++ subversion/trunk/subversion/libsvn_ra_svn/cyrus_auth.c Thu Sep  8 08:05:00 2011
@@ -738,9 +738,7 @@ svn_ra_svn__do_cyrus_auth(svn_ra_svn__se
   const char *mechstring = "", *last_err = "", *realmstring;
   const char *local_addrport = NULL, *remote_addrport = NULL;
   svn_boolean_t success;
-  /* Reserve space for 3 callbacks (for the username, password and the
-     array terminator). */
-  sasl_callback_t callbacks[3];
+  sasl_callback_t *callbacks;
   cred_baton_t cred_baton;
   int i;
 
@@ -776,6 +774,10 @@ svn_ra_svn__do_cyrus_auth(svn_ra_svn__se
   cred_baton.realmstring = realmstring;
   cred_baton.pool = pool;
 
+  /* Reserve space for 3 callbacks (for the username, password and the
+     array terminator). */
+  callbacks = apr_palloc(sess->conn->pool, sizeof(*callbacks) * 3);
+
   /* Initialize the callbacks array. */
 
   /* The username callback. */



Mime
View raw message