Joshua Kordani (jkordani {AT} roboticresearch dot com)

r1892471, r1892470, r1892118

r1892118 | stsp | 2021-08-08 20:26:28 +0000 (Sun, 08 Aug 2021)

Fix a NULL pointer dereference in the conflict resolver.

* subversion/libsvn_client/conflicts.c
  (conflict_tree_get_details_local_missing): The find_related_node() helper
   may return a NULL related_repo_relpath in some cases. Ensure that this
   will not clobber the related_repo_relpath we already calculated and
   bail out early in case we do end up with a NULL pointer.

Reported by: Joshua Kordani (jkordani {AT} roboticresearch dot com)
on users@ with a patch included in the report. Joshua kindly tested my
alternative fix for this issue and confirmed that it works as expected.

r1892470 | stsp | 2021-08-20 12:29:19 +0000 (Fri, 20 Aug 2021)

Add a regression test for an assertion failure in the conflict resolver.

With tree conflicts involving a "local missing" node the node type recorded
in wc_db may be 'none'. The resolver attempts to resolve node types with a
token map which does not support the 'none' type. This results in a failing
assertion in libsvn_subr/token.c.

* subversion/tests/cmdline/
  (merge_local_missing_node_kind_none): New test, based on a bash script
   provided by Joshua Kordani which reproduced the bug.
  (test_list): Add new test.

Reported by: Joshua Kordani (jkordani {AT} roboticresearch dot com)

r1892471 | stsp | 2021-08-20 12:39:20 +0000 (Fri, 20 Aug 2021)

Fix an assertion failure triggered by the conflict resolver.

The resolver may need to deal with nodes of type 'none' but was using
a token map which does not support the 'none' type. Switch to a token
map which supports the 'none' type. This makes the regression test
added in r1892470 pass.

The above fix uncovered a different problem where the wc_move_targets
pointer in conflict details for a "local missing" node was left as NULL.
The assumption throughout the resolver is that this variable is initialized
to an empty array instead. Do this to avoid a NULL-deref which would
otherwise be triggered by the same regression test.

* subversion/libsvn_client/conflicts.c
  (conflict_tree_get_details_local_missing): Always initialize the
    details->wc_move_targets variable.

* subversion/libsvn_wc/wc_db.c
   svn_wc__db_find_copies_of_repos_path): Use kind_map_none instead of
    the regular kind_map which doesn't support the 'none' type.

* subversion/tests/cmdline/
  (merge_local_missing_node_kind_none): Remove XFail marker.

Reported by: Joshua Kordani (jkordani {AT} roboticresearch dot com)