Bug 1584785 - Fix issues found via PVS-studio static analyzer

Differential Revision: https://phabricator.services.mozilla.com/D47559

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andy Grover 2019-09-30 09:35:42 +00:00
parent 1e13189ecb
commit 05e7a5dee3
3 changed files with 4 additions and 3 deletions

View File

@ -1698,7 +1698,7 @@ nsresult nsSocketTransport::InitiateSocket() {
//
else {
if (gSocketTransportService->IsTelemetryEnabledAndNotSleepPhase() &&
connectStarted && connectStarted) {
connectStarted && connectCalled) {
SendPRBlockingTelemetry(
connectStarted, Telemetry::PRCONNECT_FAIL_BLOCKING_TIME_NORMAL,
Telemetry::PRCONNECT_FAIL_BLOCKING_TIME_SHUTDOWN,

View File

@ -226,7 +226,7 @@ BufferedOutgoingMsg::BufferedOutgoingMsg(OutgoingMsg& msg) {
BufferedOutgoingMsg::~BufferedOutgoingMsg() {
delete mInfo;
delete mData;
delete[] mData;
}
static int receive_cb(struct socket* sock, union sctp_sockstore addr,

View File

@ -688,8 +688,9 @@ int ParseFTPList(const char* line, struct list_state* state,
}
result->fe_type = 'f';
pos = toklen[2];
while (pos > (sizeof(result->fe_size) - 1))
if (pos > (sizeof(result->fe_size) - 1)) {
pos = (sizeof(result->fe_size) - 1);
}
memcpy(result->fe_size, tokens[2], pos);
result->fe_size[pos] = '\0';
} else {