diff --git a/netwerk/protocol/http/HttpBaseChannel.cpp b/netwerk/protocol/http/HttpBaseChannel.cpp index a7c3e9a58fb9..f809889d182a 100644 --- a/netwerk/protocol/http/HttpBaseChannel.cpp +++ b/netwerk/protocol/http/HttpBaseChannel.cpp @@ -2973,7 +2973,11 @@ HttpBaseChannel::SetupReplacementChannel(nsIURI *newURI, httpChannel->SetAllowPipelining(mAllowPipelining); httpChannel->SetAllowSTS(mAllowSTS); // convey the new redirection limit - httpChannel->SetRedirectionLimit(mRedirectionLimit - 1); + // make sure we don't underflow + uint32_t redirectionLimit = mRedirectionLimit + ? mRedirectionLimit - 1 + : 0; + httpChannel->SetRedirectionLimit(redirectionLimit); // convey the Accept header value {