1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 01:27:28 +00:00

fix: crash on large udp announce response (#4022)

Fixes #4006.
This commit is contained in:
Charles Kerr 2022-10-24 17:58:19 -05:00 committed by GitHub
parent e8079835d3
commit 088e146cee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -225,10 +225,8 @@ struct tau_announce_request
response.leechers = buf.toUint32();
response.seeders = buf.toUint32();
auto const compact_len = std::size(buf);
auto contiguous = std::array<uint8_t, 576>{};
buf.toBuf(std::data(contiguous), compact_len);
response.pex = tr_pex::fromCompact4(std::data(contiguous), compact_len, nullptr, 0);
auto const contiguous = std::vector<std::byte>{ std::begin(buf), std::end(buf) };
response.pex = tr_pex::fromCompact4(std::data(contiguous), std::size(contiguous), nullptr, 0);
requestFinished();
}
else