From: Remi Gacogne Date: Fri, 17 Apr 2026 11:06:27 +0000 (+0200) Subject: dnsdist: Don't try to convert consumed bytes to a nghttp2 error X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7db0a147fd9255cd4b4349492a311e9841757113;p=thirdparty%2Fpdns.git dnsdist: Don't try to convert consumed bytes to a nghttp2 error Signed-off-by: Remi Gacogne --- diff --git a/pdns/dnsdistdist/dnsdist-nghttp2.cc b/pdns/dnsdistdist/dnsdist-nghttp2.cc index 3edcbd5897..d26ff2ef65 100644 --- a/pdns/dnsdistdist/dnsdist-nghttp2.cc +++ b/pdns/dnsdistdist/dnsdist-nghttp2.cc @@ -403,9 +403,12 @@ void DoHConnectionToBackend::handleReadableIOCallback(int fd, FDMultiplexer::fun // cerr<<"nghttp2_session_mem_recv returned "<(readlen) < conn->d_inPos) { + if (readlen < 0) { throw std::runtime_error("Fatal error while passing received data to nghttp2: " + std::string(nghttp2_strerror(static_cast(readlen)))); } + if (static_cast(readlen) < conn->d_inPos) { + throw std::runtime_error("Data was not entirely processed (" + std::to_string(readlen) + " bytes out of " + std::to_string(conn->d_inPos) + ") while passing received data to nghttp2"); + } struct timeval now{ .tv_sec = 0, .tv_usec = 0};