Bug 686118 - Segfault when passing undefined to GlodaUtils.deMime r=bienvenu
authorJonathan Protzenko <jonathan.protzenko@gmail.com>
Sat, 17 Sep 2011 21:16:48 +0200
changeset 9191 9c042ec0a30341f17973e4241f3e27c7ae2030cb
parent 9190 108bd8f798118773383af335d8536f474d0e747b
child 9192 adb328ea98c92ce1af4fbf50cc8b31238407f98c
push id230
push userbugzilla@standard8.plus.com
push dateTue, 08 Nov 2011 22:55:24 +0000
treeherdercomm-beta@63dad5648415 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbienvenu
bugs686118
Bug 686118 - Segfault when passing undefined to GlodaUtils.deMime r=bienvenu
mailnews/mime/src/nsMimeConverter.cpp
--- a/mailnews/mime/src/nsMimeConverter.cpp
+++ b/mailnews/mime/src/nsMimeConverter.cpp
@@ -83,16 +83,18 @@ nsMimeConverter::DecodeMimeHeaderToCharP
 // Decode routine (also converts output to unicode)
 nsresult 
 nsMimeConverter::DecodeMimeHeader(const char *header,
                                   const char *default_charset,
                                   PRBool override_charset,
                                   PRBool eatContinuations,
                                   nsAString& decodedString)
 {
+  NS_ENSURE_ARG_POINTER(header);
+
   char *decodedCstr = nsnull;
 
   // apply MIME decode.
   decodedCstr = MIME_DecodeMimeHeader(header, default_charset,
                                       override_charset, eatContinuations);
   if (nsnull == decodedCstr) {
     CopyUTF8toUTF16(nsDependentCString(header), decodedString);
   } else {