#584: M1507180 M1598605

This commit is contained in:
Cameron Kaiser 2019-12-21 00:20:43 -08:00
parent f0a4e76864
commit 7b58ac561d
4 changed files with 10 additions and 3 deletions

View File

@ -64,7 +64,8 @@ StreamControl::CloseAllReadStreams()
{ {
AssertOwningThread(); AssertOwningThread();
ReadStreamList::ForwardIterator iter(mReadStreamList); auto readStreamList = mReadStreamList;
ReadStreamList::ForwardIterator iter(readStreamList);
while (iter.HasMore()) { while (iter.HasMore()) {
iter.GetNext()->CloseStream(); iter.GetNext()->CloseStream();
} }

View File

@ -974,6 +974,7 @@ GatherBaselineRequirementsTelemetry(const ScopedCERTCertList& certList)
// According to DNS.h, this includes space for the null-terminator // According to DNS.h, this includes space for the null-terminator
char buf[net::kNetAddrMaxCStrBufSize] = { 0 }; char buf[net::kNetAddrMaxCStrBufSize] = { 0 };
PRNetAddr addr; PRNetAddr addr;
memset(&addr, 0, sizeof(addr));
if (currentName->name.other.len == 4) { if (currentName->name.other.len == 4) {
addr.inet.family = PR_AF_INET; addr.inet.family = PR_AF_INET;
memcpy(&addr.inet.ip, currentName->name.other.data, memcpy(&addr.inet.ip, currentName->name.other.data,

View File

@ -23,6 +23,7 @@
#include "nsServiceManagerUtils.h" #include "nsServiceManagerUtils.h"
#include "nsXULAppAPI.h" #include "nsXULAppAPI.h"
#include "PSMRunnable.h" #include "PSMRunnable.h"
#include "mozilla/net/DNS.h"
#include "secerr.h" #include "secerr.h"
@ -677,8 +678,10 @@ GetSubjectAltNames(CERTCertificate *nssCert,
case certIPAddress: case certIPAddress:
{ {
char buf[INET6_ADDRSTRLEN]; // According to DNS.h, this includes space for the null-terminator
char buf[net::kNetAddrMaxCStrBufSize] = {0};
PRNetAddr addr; PRNetAddr addr;
memset(&addr, 0, sizeof(addr));
if (current->name.other.len == 4) { if (current->name.other.len == 4) {
addr.inet.family = PR_AF_INET; addr.inet.family = PR_AF_INET;
memcpy(&addr.inet.ip, current->name.other.data, current->name.other.len); memcpy(&addr.inet.ip, current->name.other.data, current->name.other.len);

View File

@ -19,6 +19,7 @@
#include "nsIDateTimeFormat.h" #include "nsIDateTimeFormat.h"
#include "nsDateTimeFormatCID.h" #include "nsDateTimeFormatCID.h"
#include "nsServiceManagerUtils.h" #include "nsServiceManagerUtils.h"
#include "mozilla/net/DNS.h"
#include <algorithm> #include <algorithm>
using namespace mozilla; using namespace mozilla;
@ -1033,8 +1034,9 @@ ProcessGeneralName(PLArenaPool *arena,
break; break;
case certIPAddress: case certIPAddress:
{ {
char buf[INET6_ADDRSTRLEN];
PRStatus status = PR_FAILURE; PRStatus status = PR_FAILURE;
// According to DNS.h, this includes space for the null-terminator
char buf[net::kNetAddrMaxCStrBufSize] = {0};
PRNetAddr addr; PRNetAddr addr;
memset(&addr, 0, sizeof(addr)); memset(&addr, 0, sizeof(addr));
nssComponent->GetPIPNSSBundleString("CertDumpIPAddress", key); nssComponent->GetPIPNSSBundleString("CertDumpIPAddress", key);