Skip to content

Commit

Permalink
Add a check to ensure the infohash is present in the scrape reply.
Browse files Browse the repository at this point in the history
  • Loading branch information
rakshasa committed Nov 7, 2011
1 parent 22b83bc commit ba24b8e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/tracker/tracker_http.cc
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,10 @@ TrackerHttp::receive_done() {
if (b.has_key_map("files")) {
// Add better validation here...
const Object& files = b.get_key("files");

if (!files.has_key_map(m_parent->info()->hash().str()))
return receive_failed("Tracker scrape replay did not contain infohash.");

const Object& stats = files.get_key(m_parent->info()->hash().str());

if (stats.has_key_value("complete"))
Expand Down

0 comments on commit ba24b8e

Please sign in to comment.