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 2018/07/29 11:24:48 UTC
svn commit: r1836963 - /subversion/trunk/subversion/libsvn_client/conflicts.c
Author: stsp
Date: Sun Jul 29 11:24:48 2018
New Revision: 1836963
URL: http://svn.apache.org/viewvc?rev=1836963&view=rev
Log:
Fix a potential NULL dereference in the conflict resolver.
* subversion/libsvn_client/conflicts.c
(map_deleted_path_to_move): Check the result of svn_relpath_skip_ancestor().
Modified:
subversion/trunk/subversion/libsvn_client/conflicts.c
Modified: subversion/trunk/subversion/libsvn_client/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/conflicts.c?rev=1836963&r1=1836962&r2=1836963&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_client/conflicts.c Sun Jul 29 11:24:48 2018
@@ -806,18 +806,20 @@ map_deleted_path_to_move(const char *del
if (closest_move)
{
const char *relpath;
- const char *moved_along_path;
- struct repos_move_info *move;
/* See if we can find an even closer move for this moved-along path. */
relpath = svn_relpath_skip_ancestor(closest_move->moved_to_repos_relpath,
deleted_relpath);
- moved_along_path =
- svn_relpath_join(closest_move->moved_from_repos_relpath, relpath,
- scratch_pool);
- move = map_deleted_path_to_move(moved_along_path, moves, scratch_pool);
- if (move)
- return move;
+ if (relpath && relpath[0] != '\0')
+ {
+ struct repos_move_info *move;
+ const char *moved_along_path =
+ svn_relpath_join(closest_move->moved_from_repos_relpath, relpath,
+ scratch_pool);
+ move = map_deleted_path_to_move(moved_along_path, moves, scratch_pool);
+ if (move)
+ return move;
+ }
}
return closest_move;