diff --git a/src/eepp/network/http.cpp b/src/eepp/network/http.cpp index f22e1d638..0ee532528 100644 --- a/src/eepp/network/http.cpp +++ b/src/eepp/network/http.cpp @@ -225,7 +225,8 @@ void Http::Response::parse(const std::string& data) { // Copy the actual content data std::istreambuf_iterator it(in); - for (std::size_t i = 0; i < length; i++) + std::istreambuf_iterator itEnd; + for (std::size_t i = 0; ((i < length) && (it != itEnd)); i++) mBody.push_back(*it++); }