You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2013/10/25 03:04:07 UTC

svn commit: r1535600 - /subversion/trunk/subversion/bindings/javahl/native/OperationContext.cpp

Author: brane
Date: Fri Oct 25 01:04:06 2013
New Revision: 1535600

URL: http://svn.apache.org/r1535600
Log:
Avoid a "may be used uninitialized" error in JavaHL.

* subversion/bindings/javahl/native/OperationContext.cpp
  (OperationContext::getAuthBaton): Properly nullify all prompt
   functions and batons if we don't have a prompter callback.
   Before this change, one of them was left uninitialized.

Modified:
    subversion/trunk/subversion/bindings/javahl/native/OperationContext.cpp

Modified: subversion/trunk/subversion/bindings/javahl/native/OperationContext.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/OperationContext.cpp?rev=1535600&r1=1535599&r2=1535600&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/OperationContext.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/OperationContext.cpp Fri Oct 25 01:04:06 2013
@@ -153,10 +153,10 @@ OperationContext::getAuthBaton(SVN::Pool
 
       /* Use the prompter (if available) to prompt for password and cert
        * caching. */
-      svn_auth_plaintext_prompt_func_t plaintext_prompt_func = NULL;
-      void *plaintext_prompt_baton = NULL;
+      svn_auth_plaintext_prompt_func_t plaintext_prompt_func;
+      void *plaintext_prompt_baton;
       svn_auth_plaintext_passphrase_prompt_func_t plaintext_passphrase_prompt_func;
-      void *plaintext_passphrase_prompt_baton = NULL;
+      void *plaintext_passphrase_prompt_baton;
 
       if (m_prompter != NULL)
         {
@@ -165,6 +165,13 @@ OperationContext::getAuthBaton(SVN::Pool
           plaintext_passphrase_prompt_func = Prompter::plaintext_passphrase_prompt;
           plaintext_passphrase_prompt_baton = m_prompter;
         }
+      else
+        {
+          plaintext_prompt_func = NULL;
+          plaintext_prompt_baton = NULL;
+          plaintext_passphrase_prompt_func = NULL;
+          plaintext_passphrase_prompt_baton = NULL;
+        }
 
       /* The main disk-caching auth providers, for both
        * 'username/password' creds and 'username' creds.  */