diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2026-11-07 13:30:17 +0100 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2026-11-07 13:30:17 +0100 |
| commit | cfbe53da5d9ef8dad1bb3276c0b33ec2ab6e974b (patch) | |
| tree | c553990fd398d9d20dab09df5ecdcba1da71264e /tests | |
| parent | bbfd674e08c6b1fa4081f9c678fd220bead749d7 (diff) | |
Fix s24s stats to ensure no unallocated vector is dereferenced. Drive-by fix for the ip= scanner in the http parser
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/integration/test_stats.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/integration/test_stats.py b/tests/integration/test_stats.py index 088d8a1..c4ac95a 100644 --- a/tests/integration/test_stats.py +++ b/tests/integration/test_stats.py | |||
| @@ -177,6 +177,15 @@ class StatsNetworks(TrackerTestCase): | |||
| 177 | for line in lines: | 177 | for line in lines: |
| 178 | self.assertEqual(int(line.split(b":")[0]), 3, "three peers from the one network") | 178 | self.assertEqual(int(line.split(b":")[0]), 3, "three peers from the one network") |
| 179 | 179 | ||
| 180 | def test_the_report_survives_a_torrent_with_no_v4_peers(self): | ||
| 181 | # A torrent whose only peer is v6 has no v4 peer list once the lists | ||
| 182 | # are allocated on demand. The s24 report walks the v4 list of every | ||
| 183 | # torrent, so it has to skip the absent one rather than follow a null | ||
| 184 | # pointer. Needs WANT_IP_FROM_QUERY_STRING to force the family; without | ||
| 185 | # it the peer is loopback v4 and the walk is never asked to skip. | ||
| 186 | self.tracker.announce(self.hash_for("s24v6only"), ip="2001:db8::1", port=6001, left=0) | ||
| 187 | self.assertIn(b"Networks, limit /24:", self.tracker.stats("s24s")) | ||
| 188 | |||
| 180 | 189 | ||
| 181 | if __name__ == "__main__": | 190 | if __name__ == "__main__": |
| 182 | unittest.main() | 191 | unittest.main() |
