summaryrefslogtreecommitdiffstats
path: root/mailnews/mime/src
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2019-11-10 22:54:16 -0500
committerMatt A. Tobin <email@mattatobin.com>2019-11-10 22:54:16 -0500
commitfa9ca98c398438edfd77b876f9e4b666cac4fdf9 (patch)
tree921a005b4df479b06e17802c93829480437f63d3 /mailnews/mime/src
parent5d21f962db500a22697221d985709d5f24fa27f5 (diff)
downloadUXP-fa9ca98c398438edfd77b876f9e4b666cac4fdf9.tar
UXP-fa9ca98c398438edfd77b876f9e4b666cac4fdf9.tar.gz
UXP-fa9ca98c398438edfd77b876f9e4b666cac4fdf9.tar.lz
UXP-fa9ca98c398438edfd77b876f9e4b666cac4fdf9.tar.xz
UXP-fa9ca98c398438edfd77b876f9e4b666cac4fdf9.zip
Bug 1401858 - add null check to avoid crash in EncodedHeader()/DecodedHeader().
Tag #1273
Diffstat (limited to 'mailnews/mime/src')
-rw-r--r--mailnews/mime/src/MimeHeaderParser.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/mailnews/mime/src/MimeHeaderParser.cpp b/mailnews/mime/src/MimeHeaderParser.cpp
index 18d81023e..4fd7bc982 100644
--- a/mailnews/mime/src/MimeHeaderParser.cpp
+++ b/mailnews/mime/src/MimeHeaderParser.cpp
@@ -10,7 +10,6 @@
#include "nsMemory.h"
#include "nsAutoPtr.h"
#include "nsCOMPtr.h"
-#include "nsIMimeConverter.h"
#include "nsIMsgHeaderParser.h"
namespace mozilla {
@@ -76,6 +75,7 @@ nsCOMArray<msgIAddressObject> DecodedHeader(const nsAString &aHeader)
return retval;
}
nsCOMPtr<nsIMsgHeaderParser> headerParser(services::GetHeaderParser());
+ NS_ENSURE_TRUE(headerParser, retval);
msgIAddressObject **addresses = nullptr;
uint32_t length;
nsresult rv = headerParser->ParseDecodedHeader(aHeader, false,
@@ -95,6 +95,7 @@ nsCOMArray<msgIAddressObject> EncodedHeader(const nsACString &aHeader,
return retval;
}
nsCOMPtr<nsIMsgHeaderParser> headerParser(services::GetHeaderParser());
+ NS_ENSURE_TRUE(headerParser, retval);
msgIAddressObject **addresses = nullptr;
uint32_t length;
nsresult rv = headerParser->ParseEncodedHeader(aHeader, aCharset,