Author: brane
Date: Sat May 30 20:40:53 2026
New Revision: 1934787

Log:
Fix potential usage of uninitialized memory.

[-Wsometimes-uninitialized] by clang-2100.1.1.101 on macOS.

* subversion/libsvn_client/conflicts.c: Include private/svn_debug.h.
  (conflict_tree_get_description_incoming_delete,
   conflict_tree_get_description_incoming_add,
   conflict_tree_get_details_incoming_edit,
   conflict_tree_get_description_incoming_edit): Raise a malfunction if the
    conflict operation does not have an expected value. Otherwise, the 'action'
    string could be used uninitialized.

  (conflict_tree_get_details_incoming_edit): Rename the local variable
   'operation' to 'conflict_operation', for consistency with other usage.

Modified:
   subversion/trunk/subversion/libsvn_client/conflicts.c

Modified: subversion/trunk/subversion/libsvn_client/conflicts.c
==============================================================================
--- subversion/trunk/subversion/libsvn_client/conflicts.c       Sat May 30 
20:18:05 2026        (r1934786)
+++ subversion/trunk/subversion/libsvn_client/conflicts.c       Sat May 30 
20:40:53 2026        (r1934787)
@@ -40,6 +40,7 @@
 #include "svn_subst.h"
 #include "client.h"
 
+#include "private/svn_debug.h"
 #include "private/svn_diff_tree.h"
 #include "private/svn_ra_private.h"
 #include "private/svn_sorts_private.h"
@@ -4862,7 +4863,7 @@ conflict_tree_get_description_incoming_d
                      new_repos_relpath, new_rev, result_pool);
 
         }
-      }
+    }
   else if (conflict_operation == svn_wc_operation_merge)
     {
       if (details->deleted_rev != SVN_INVALID_REVNUM)
@@ -4883,7 +4884,12 @@ conflict_tree_get_description_incoming_d
                      details, victim_node_kind, old_repos_relpath, old_rev,
                      new_repos_relpath, new_rev, result_pool);
         }
-      }
+    }
+  else
+    {
+      SVN_DBG(("unknown conflict operation: %d", (int)conflict_operation));
+      SVN_ERR_MALFUNCTION();
+    }
 
   *incoming_change_description = apr_pstrdup(result_pool, action);
 
@@ -5838,6 +5844,11 @@ conflict_tree_get_description_incoming_a
                    details, new_node_kind, old_repos_relpath,
                    old_rev, new_rev, result_pool);
     }
+  else
+    {
+      SVN_DBG(("unknown conflict operation: %d", (int)conflict_operation));
+      SVN_ERR_MALFUNCTION();
+    }
 
   *incoming_change_description = apr_pstrdup(result_pool, action);
 
@@ -5984,7 +5995,7 @@ conflict_tree_get_details_incoming_edit(
   svn_revnum_t new_rev;
   svn_node_kind_t old_node_kind;
   svn_node_kind_t new_node_kind;
-  svn_wc_operation_t operation;
+  svn_wc_operation_t conflict_operation;
   const char *url;
   const char *corrected_url;
   svn_ra_session_t *ra_session;
@@ -6001,8 +6012,8 @@ conflict_tree_get_details_incoming_edit(
   SVN_ERR(svn_client_conflict_get_repos_info(&repos_root_url, NULL,
                                              conflict,
                                              scratch_pool, scratch_pool));
-  operation = svn_client_conflict_get_operation(conflict);
-  if (operation == svn_wc_operation_update)
+  conflict_operation = svn_client_conflict_get_operation(conflict);
+  if (conflict_operation == svn_wc_operation_update)
     {
       b.node_kind = old_rev < new_rev ? new_node_kind : old_node_kind;
 
@@ -6018,8 +6029,8 @@ conflict_tree_get_details_incoming_edit(
       b.repos_relpath = old_rev < new_rev ? new_repos_relpath
                                           : old_repos_relpath;
     }
-  else if (operation == svn_wc_operation_switch ||
-           operation == svn_wc_operation_merge)
+  else if (conflict_operation == svn_wc_operation_switch ||
+           conflict_operation == svn_wc_operation_merge)
     {
       url = svn_path_url_add_component2(repos_root_url, new_repos_relpath,
                                         scratch_pool);
@@ -6027,6 +6038,11 @@ conflict_tree_get_details_incoming_edit(
       b.repos_relpath = new_repos_relpath;
       b.node_kind = new_node_kind;
     }
+  else
+    {
+      SVN_DBG(("unknown conflict operation: %d", (int)conflict_operation));
+      SVN_ERR_MALFUNCTION();
+    }
 
   SVN_ERR(svn_client__open_ra_session_internal(&ra_session,
                                                &corrected_url,
@@ -6363,6 +6379,11 @@ conflict_tree_get_description_incoming_e
             }
         }
     }
+  else
+    {
+      SVN_DBG(("unknown conflict operation: %d", (int)conflict_operation));
+      SVN_ERR_MALFUNCTION();
+    }
 
   action = apr_psprintf(scratch_pool, "%s:\n%s", action,
                         describe_incoming_edit_list_modified_revs(

Reply via email to