You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2017/12/11 22:02:48 UTC

svn commit: r1817856 - /subversion/trunk/subversion/svn/help-cmd.c

Author: danielsh
Date: Mon Dec 11 22:02:48 2017
New Revision: 1817856

URL: http://svn.apache.org/viewvc?rev=1817856&view=rev
Log:
Fix segfault when no home directory is available.

This can be reproduced by forcing svn_user_get_homedir() to return NULL.
However, I can't imagine a situation in which this would happen in practice,
so I'm marking this as:

CHANGES: skip

* subversion/svn/help-cmd.c
  (svn_cl__help): Guard for svn_config_get_user_config_path() returning NULL.

Modified:
    subversion/trunk/subversion/svn/help-cmd.c

Modified: subversion/trunk/subversion/svn/help-cmd.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/help-cmd.c?rev=1817856&r1=1817855&r2=1817856&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/help-cmd.c (original)
+++ subversion/trunk/subversion/svn/help-cmd.c Mon Dec 11 22:02:48 2017
@@ -148,21 +148,24 @@ svn_cl__help(apr_getopt_t *os,
                            _("\nThe following authentication credential caches are available:\n\n"));
 
   /*### There is no API to query available providers at run time. */
+  if (config_path)
+    {
 #if (defined(WIN32) && !defined(__MINGW32__))
-  version_footer =
-    svn_stringbuf_create(apr_psprintf(pool, _("%s* Wincrypt cache in %s\n"),
-                                      version_footer->data,
-                                      svn_dirent_local_style(config_path,
-                                                             pool)),
-                         pool);
+      version_footer =
+        svn_stringbuf_create(apr_psprintf(pool, _("%s* Wincrypt cache in %s\n"),
+                                          version_footer->data,
+                                          svn_dirent_local_style(config_path,
+                                                                 pool)),
+                             pool);
 #elif !defined(SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE)
-  version_footer =
-    svn_stringbuf_create(apr_psprintf(pool, _("%s* Plaintext cache in %s\n"),
-                                      version_footer->data,
-                                      svn_dirent_local_style(config_path,
-                                                             pool)),
-                         pool);
+      version_footer =
+        svn_stringbuf_create(apr_psprintf(pool, _("%s* Plaintext cache in %s\n"),
+                                          version_footer->data,
+                                          svn_dirent_local_style(config_path,
+                                                                 pool)),
+                             pool);
 #endif
+    }
 #ifdef SVN_HAVE_GNOME_KEYRING
   svn_stringbuf_appendcstr(version_footer, "* Gnome Keyring\n");
 #endif