Submitter | phabricator |
---|---|
Date | Nov. 5, 2019, 11:41 p.m. |
Message ID | <differential-rev-PHID-DREV-vyobhbt6qjndkmydowc6-req@mercurial-scm.org> |
Download | mbox | patch |
Permalink | /patch/42759/ |
State | Superseded |
Headers | show |
Comments
indygreg added a comment. I had to drop this from `hg-committed` because Python 3 was not amused: `SystemError: <method 'addpath' of 'parsers.dirs' objects> returned NULL without setting an error` PTAL @durin42 REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7234/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7234 To: durin42, #hg-reviewers, indygreg Cc: mercurial-devel
Patch
diff --git a/mercurial/cext/dirs.c b/mercurial/cext/dirs.c --- a/mercurial/cext/dirs.c +++ b/mercurial/cext/dirs.c @@ -66,6 +66,11 @@ while ((pos = _finddir(cpath, pos - 1)) != -1) { PyObject *val; + // Sniff for trailing slashes, a marker of an invalid input. + if (cpath[pos] == '/') { + goto bail; + } + key = PyBytes_FromStringAndSize(cpath, pos); if (key == NULL) goto bail;