From cea77b76b3fef912bd79e777f97d353aa50474b6 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Sun, 10 Nov 2019 21:59:52 -0500 Subject: Bug 1333038 - Use 'modern' pointers to fix crash due to nsMsgLineStreamBuffer object being deleted while still in use. Suspected "use after free" in nsMsgLineStreamBuffer::ReadNextLine() leading to crash since object may be destroyed while still in use on another thread. Tag #1273 --- mailnews/compose/src/nsSmtpProtocol.cpp | 1 - mailnews/compose/src/nsSmtpProtocol.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'mailnews/compose/src') diff --git a/mailnews/compose/src/nsSmtpProtocol.cpp b/mailnews/compose/src/nsSmtpProtocol.cpp index 04347c1d0..522890c78 100644 --- a/mailnews/compose/src/nsSmtpProtocol.cpp +++ b/mailnews/compose/src/nsSmtpProtocol.cpp @@ -236,7 +236,6 @@ nsSmtpProtocol::~nsSmtpProtocol() { // free our local state PR_Free(m_dataBuf); - delete m_lineStreamBuffer; } void nsSmtpProtocol::Initialize(nsIURI * aURL) diff --git a/mailnews/compose/src/nsSmtpProtocol.h b/mailnews/compose/src/nsSmtpProtocol.h index c8cbf1406..b1370d4be 100644 --- a/mailnews/compose/src/nsSmtpProtocol.h +++ b/mailnews/compose/src/nsSmtpProtocol.h @@ -143,7 +143,7 @@ private: int32_t m_previousResponseCode; int32_t m_continuationResponse; nsCString m_responseText; /* text returned from Smtp server */ - nsMsgLineStreamBuffer *m_lineStreamBuffer; // used to efficiently extract lines from the incoming data stream + RefPtr m_lineStreamBuffer; // used to efficiently extract lines from the incoming data stream nsTArray m_addresses; uint32_t m_addressesLeft; -- cgit v1.2.3