mirror of
https://github.com/transmission/transmission
synced 2025-02-23 06:30:38 +00:00
fix: add nullptr dereference safguard in announcer code
This commit is contained in:
parent
b8e7b15804
commit
b155374137
1 changed files with 13 additions and 2 deletions
|
@ -1401,10 +1401,21 @@ void multiscrape(tr_announcer_impl* announcer, std::vector<tr_tier*> const& tier
|
||||||
// batch as many info_hashes into a request as we can
|
// batch as many info_hashes into a request as we can
|
||||||
for (auto* tier : tiers)
|
for (auto* tier : tiers)
|
||||||
{
|
{
|
||||||
auto const* const scrape_info = tier->currentTracker()->scrape_info;
|
auto const* const current_tracker = tier->currentTracker();
|
||||||
bool found = false;
|
TR_ASSERT(current_tracker != nullptr);
|
||||||
|
if (current_tracker == nullptr)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto const* const scrape_info = current_tracker->scrape_info;
|
||||||
TR_ASSERT(scrape_info != nullptr);
|
TR_ASSERT(scrape_info != nullptr);
|
||||||
|
if (scrape_info == nullptr)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool found = false;
|
||||||
|
|
||||||
/* if there's a request with this scrape URL and a free slot, use it */
|
/* if there's a request with this scrape URL and a free slot, use it */
|
||||||
for (size_t j = 0; !found && j < request_count; ++j)
|
for (size_t j = 0; !found && j < request_count; ++j)
|
||||||
|
|
Loading…
Reference in a new issue