[jboss-jira] [JBoss JIRA] Created: (JBMAIL-247) MessageData NPE in getBoundary when Content-Type header is missing

David Fuelling (JIRA) jira-events at jboss.com
Fri Aug 18 11:24:42 EDT 2006


MessageData NPE in getBoundary when Content-Type header is missing
------------------------------------------------------------------

                 Key: JBMAIL-247
                 URL: http://jira.jboss.com/jira/browse/JBMAIL-247
             Project: JBoss Mail
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: IMAP, Mail Server APIs, POP, WebMail
    Affects Versions: 1.5-M4, 1.5-M5
         Environment: WinXP, JBossAS 4.0.4GA_Patch1, JBCS Head as of July 31st, 2006.
            Reporter: David Fuelling
         Assigned To: Andrew Oliver
            Priority: Minor


See forum post here:
http://www.jboss.org/index.html?module=bb&op=viewtopic&t=88893

Here is a patch.  It simply moves the creation of the "header" string array inside of the try/catch block.  If an exception is thrown, it is caught and ignored.


Index: MessageData.java
===================================================================
RCS file: /cvsroot/jboss/jboss-mail/src/java/org/jboss/mail/mailbox/MessageData.java,v
retrieving revision 1.21
diff -u -r1.21 MessageData.java
--- MessageData.java	11 Jun 2006 14:06:23 -0000	1.21
+++ MessageData.java	18 Aug 2006 15:16:02 -0000
@@ -342,9 +342,9 @@
     }
     
     public String getBoundary() {
-    	String[] header = getHeader("Content-Type").split("\\r\\n");
-		String retval = null;
+    	String retval = null;
 		try {
+			String[] header = getHeader("Content-Type").split("\\r\\n");
 			for (int i = 0; header != null && i < header.length; i++) {
 				if( header[i].indexOf("boundary=\"") >-1) {
 					String[] temp =  header[i].split("boundary\\=\\\"");


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list