Bug 574961 - crash [@ MimeHeaders_get(MimeHeaders*, char const*, int, int)] [@ MimeHeaders_get_name] [@ @0x0 | MimeHeaders_get_name(MimeHeaders*, MimeDisplayOptions*)]. Add test case. r=bienvenu
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Fri, 07 Jan 2011 22:11:07 +0900
changeset 6949 4bcbe30040790de38fda0ddaed10e563d5badcec
parent 6948 612d538f10407258831ca0139d501038edafebd1
child 6950 5ee881bd297303ffe17200d897df416b0e02e948
push idunknown
push userunknown
push dateunknown
reviewersbienvenu
bugs574961
Bug 574961 - crash [@ MimeHeaders_get(MimeHeaders*, char const*, int, int)] [@ MimeHeaders_get_name] [@ @0x0 | MimeHeaders_get_name(MimeHeaders*, MimeDisplayOptions*)]. Add test case. r=bienvenu
mailnews/mime/test/unit/test_mimeContentType.js
--- a/mailnews/mime/test/unit/test_mimeContentType.js
+++ b/mailnews/mime/test/unit/test_mimeContentType.js
@@ -73,16 +73,31 @@ function run_test()
       result:
       null
     },
     { header:
       "Content-Type:\r\n" +
       "\r\n",
       result:
       null
+    },
+    /* possible crash case for Bug 574961 */
+    { header:
+      "Content-Type: \r\n" +
+      "                                " +
+      "                                " +
+      "                                " +
+      "                                " +
+      "                                " +
+      "                                " +
+      "                                " +
+      "                                " +
+      "              \r\n",
+      result:
+      null,
     }
   ];
 
   let mimeHdr = Components.classes["@mozilla.org/messenger/mimeheaders;1"]
                   .createInstance(Components.interfaces.nsIMimeHeaders);
 
   for (let i = 0; i < headers.length; i++) {
     mimeHdr.initialize(headers[i].header, headers[i].header.length);