Commit 7a374dd4 authored by Philipp Winter's avatar Philipp Winter Committed by George Kadianakis
Browse files

Only search for mark in expected space.

We know in which array slice the mark is expected.  As a result, we don't have
to look any further than that.  Patch by Yawning Angel.  See the following
ticket for reference: <https://bugs.torproject.org/11092>.
parent 18db73dd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ def locateMark( mark, payload ):
    `mark' could not be found, `None' is returned.
    """

    index = payload.find(mark)
    index = payload.find(mark, 0, const.MAX_PADDING_LENGTH + const.MARK_LENGTH)
    if index < 0:
        log.debug("Could not find the mark just yet.")
        return None