Martin von Zweigbergk <martinvonz@google.com> [Mon, 06 Aug 2018 22:24:34 -0700] rev 38936
index: use PyMem_Free() to free nodeetree instance
As Yuya pointed out in the review of D4108, PyMem_Malloc() and
PyMem_Free() should be paired. IIUC, PyMem_Malloc() may use a
different allocator than malloc(), so using free() with a pointer from
PyMem_Malloc() may be very wrong.
Differential Revision: https://phab.mercurial-scm.org/D4152
Jun Wu <quark@fb.com> [Mon, 06 Aug 2018 22:24:00 -0700] rev 38935
linelog: fix infinite loop vulnerability
Checking `len(lines)` is not a great way of detecting infinite loops, as
demonstrated in the added test. Therefore check instruction count instead.
The original C implementation does not have this problem. There are a few
other places where the C implementation enforces more strictly, like
`a1 <= a2`, `b1 <= b2`, `rev > 0`. But they are optional.
Test Plan:
Add a test. The old code forces the test to time out.
Differential Revision: https://phab.mercurial-scm.org/D4151
Augie Fackler <augie@google.com> [Mon, 06 Aug 2018 17:19:33 -0400] rev 38934
tests: fix bytes/str issues in run-tests.py caught by python3
Differential Revision: https://phab.mercurial-scm.org/D4143