You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2021/01/29 13:17:16 UTC

svn commit: r1886019 - /subversion/trunk/subversion/libsvn_repos/config_file.c

Author: stsp
Date: Fri Jan 29 13:17:15 2021
New Revision: 1886019

URL: http://svn.apache.org/viewvc?rev=1886019&view=rev
Log:
Fix a potential NULL dereference in the config file parser.

* subversion/libsvn_repos/config_file.c
  (get_repos_config): svn_repos_find_root_path() may return NULL.
   Check the return value accordingly.

Modified:
    subversion/trunk/subversion/libsvn_repos/config_file.c

Modified: subversion/trunk/subversion/libsvn_repos/config_file.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/config_file.c?rev=1886019&r1=1886018&r2=1886019&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/config_file.c (original)
+++ subversion/trunk/subversion/libsvn_repos/config_file.c Fri Jan 29 13:17:15 2021
@@ -237,6 +237,10 @@ get_repos_config(svn_stream_t **stream,
     {
       /* Search for a repository in the full path. */
       repos_root_dirent = svn_repos_find_root_path(dirent, scratch_pool);
+      if (repos_root_dirent == NULL)
+        return svn_error_trace(handle_missing_file(stream, checksum, access,
+                                                   url, must_exist,
+                                                   svn_node_none));
 
       /* Attempt to open a repository at repos_root_dirent. */
       SVN_ERR(svn_repos_open3(&access->repos, repos_root_dirent, NULL,