From c02f8f228eef441e6531c695eb90775a8fe958a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Wed, 27 Oct 2021 12:14:14 +0200 Subject: [PATCH] aquatic_http_protocol: fail scrape parse with no info hashes --- aquatic_http_protocol/src/request.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aquatic_http_protocol/src/request.rs b/aquatic_http_protocol/src/request.rs index 95f0fdd..9b8e2ee 100644 --- a/aquatic_http_protocol/src/request.rs +++ b/aquatic_http_protocol/src/request.rs @@ -238,6 +238,10 @@ impl Request { Ok(Request::Announce(request)) } else { + if info_hashes.is_empty() { + return Err(anyhow::anyhow!("No info hashes sent")); + } + let request = ScrapeRequest { info_hashes }; Ok(Request::Scrape(request))