This is an archive of the discontinued Mercurial Phabricator instance.

dirs: reject consecutive slashes in paths
ClosedPublic

Authored by durin42 on Nov 5 2019, 6:41 PM.

Details

Summary

We shouldn't ever see those, and the fuzzer go really excited that if
it gives us a 65k string with 55k slashes in it we use a lot of RAM.

This is a better fix than what I tried in D7105. It was suggested by
Yuya, and I verified it does in fact cause the fuzzer to not OOM.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

durin42 created this revision.Nov 5 2019, 6:41 PM
durin42 updated this revision to Diff 17564.Nov 5 2019, 6:46 PM
indygreg accepted this revision.Nov 5 2019, 10:26 PM
This revision is now accepted and ready to land.Nov 5 2019, 10:26 PM
This revision was automatically updated to reflect the committed changes.

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