You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2013/09/25 06:26:08 UTC
svn commit: r1526103 - /subversion/trunk/subversion/libsvn_client/copy.c
Author: brane
Date: Wed Sep 25 04:26:08 2013
New Revision: 1526103
URL: http://svn.apache.org/r1526103
Log:
Do not crash if the sources of a move or copy API call is empty.
* subversion/libsvn_client/copy.c (try_copy):
Add assertion that the source array contains at least one element.
Modified:
subversion/trunk/subversion/libsvn_client/copy.c
Modified: subversion/trunk/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/copy.c?rev=1526103&r1=1526102&r2=1526103&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/copy.c (original)
+++ subversion/trunk/subversion/libsvn_client/copy.c Wed Sep 25 04:26:08 2013
@@ -1945,6 +1945,9 @@ try_copy(svn_boolean_t *timestamp_sleep,
svn_boolean_t srcs_are_urls, dst_is_url;
int i;
+ /* Assert instead of crashing if the sources list is empty. */
+ SVN_ERR_ASSERT(sources->nelts > 0);
+
/* Are either of our paths URLs? Just check the first src_path. If
there are more than one, we'll check for homogeneity among them
down below. */