Commit Graph

7 Commits

Author SHA1 Message Date
Yuya Nishihara
01d4a46e15 reachableroots: verify integer range of heads argument (issue4775)
Now it raises IndexError instead of SEGV for 'wdir()' as it was before.
2015-08-13 18:38:46 +09:00
Yuya Nishihara
d210a7a2bf reachableroots: unify bail cases to raise exception correctly
Before this patch, release_seen_and_tovisit did not return NULL, so the
exception was not raised immediately. As Py_XDECREF() and free() are safe
for NULL, we can simply bail in any case.
2015-08-13 18:29:38 +09:00
Yuya Nishihara
d7d0977d82 tests: disable test of buffer overflow in parsers.c if --pure
It fails with AttributeError and there's no benefit to make it runnable
with pure Python code.
2015-07-19 15:27:28 +09:00
Yuya Nishihara
83b3c48a90 parsers: fix buffer overflow by invalid parent revision read from revlog
If revlog file is corrupted, it can have parent pointing to invalid revision.
So we should validate it before updating nothead[], phases[], seen[], etc.
Otherwise it would cause segfault at best.

We could use "rev" instead of "maxrev" as upper bound, but I think the explicit
"maxrev" can clarify that we just want to avoid possible buffer overflow
vulnerability.
2015-07-16 23:36:08 +09:00
Mads Kiilerich
fa1c4e5ebe tests: add missing trailing 'cd ..'
Many tests didn't change back from subdirectories at the end of the tests ...
and they don't have to. The missing 'cd ..' could always be added when another
test case is added to the test file.

This change do that tests (99.5%) consistently end up in $TESTDIR where they
started, thus making it simpler to extend them or move them around.
2012-06-11 01:40:51 +02:00
Adrian Buehlmann
cf126bb7dd move opener from util to scmutil 2011-04-20 19:54:57 +02:00
Matt Mackall
908997b892 tests: unify test-parseindex 2010-09-26 13:44:49 -05:00