subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1758069 - /subversion/trunk/subversion/libsvn_subr/dirent_uri.c
Date Sat, 27 Aug 2016 21:02:27 GMT
Author: stsp
Date: Sat Aug 27 21:02:27 2016
New Revision: 1758069

URL: http://svn.apache.org/viewvc?rev=1758069&view=rev
Log:
Fix issue #4652 which shows how to trigger an assertion failure in
svn_dirent_get_absolute() by passing invalid input on the command line.

Report a proper error message instead.

* subversion/libsvn_subr/dirent_uri.c
  (svn_dirent_get_absolute): If the caller passed a URL, return an error.

Modified:
    subversion/trunk/subversion/libsvn_subr/dirent_uri.c

Modified: subversion/trunk/subversion/libsvn_subr/dirent_uri.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/dirent_uri.c?rev=1758069&r1=1758068&r2=1758069&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/dirent_uri.c (original)
+++ subversion/trunk/subversion/libsvn_subr/dirent_uri.c Sat Aug 27 21:02:27 2016
@@ -1598,7 +1598,10 @@ svn_dirent_get_absolute(const char **pab
   apr_status_t apr_err;
   const char *path_apr;
 
-  SVN_ERR_ASSERT(! svn_path_is_url(relative));
+  if (svn_path_is_url(relative))
+    return svn_error_createf(SVN_ERR_BAD_FILENAME, NULL,
+                             _("Local path expected but '%s' looks like a URL"),
+                             relative);
 
   /* Merge the current working directory with the relative dirent. */
   SVN_ERR(svn_path_cstring_from_utf8(&path_apr, relative, pool));



Mime
View raw message