Patchwork D2669: util: fix unsafe url abort with bytestr() on url

login
register
mail settings
Submitter phabricator
Date March 4, 2018, 9:13 p.m.
Message ID <differential-rev-PHID-DREV-a3gsrp3f6d7hhjfk3j4z-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28997/
State Superseded
Headers show

Comments

phabricator - March 4, 2018, 9:13 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2669

AFFECTED FILES
  mercurial/util.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -3097,7 +3097,7 @@ 
     path = urlreq.unquote(path)
     if path.startswith('ssh://-') or path.startswith('svn+ssh://-'):
         raise error.Abort(_('potentially unsafe url: %r') %
-                          (path,))
+                          (pycompat.bytestr(path),))
 
 def hidepassword(u):
     '''hide user credential in a url string'''