diff --git a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp index 54dffcc62cdf..187ee75d4890 100644 --- a/netwerk/protocol/http/nsHttpHandler.cpp +++ b/netwerk/protocol/http/nsHttpHandler.cpp @@ -2743,7 +2743,11 @@ void nsHttpHandler::ShutdownConnectionManager() { nsresult nsHttpHandler::NewChannelId(uint64_t& channelId) { channelId = - ((static_cast(mProcessId) << 32) & 0xFFFFFFFF00000000LL) | + // channelId is sometimes passed to JavaScript code (e.g. devtools), + // and since on Linux PID_MAX_LIMIT is 2^22 we cannot + // shift PID more than 31 bits left. Otherwise resulting values + // will be exceed safe JavaScript integer range. + ((static_cast(mProcessId) << 31) & 0xFFFFFFFF80000000LL) | mNextChannelId++; return NS_OK; }