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

Andrew Oliver (JIRA) jira-events at jboss.com
Wed Dec 13 19:27:22 EST 2006


     [ http://jira.jboss.com/jira/browse/JBMAIL-247?page=all ]

Andrew Oliver closed JBMAIL-247.
--------------------------------

    Resolution: Won't Fix
      Assignee:     (was: Andrew Oliver)

> 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 ** Closed - moved to http://buni.org **
>          Issue Type: Patch
>      Security Level: Public(Everyone can see) 
>          Components: POP, Mail Server APIs, WebMail, IMAP
>    Affects Versions: 1.0-M2
>         Environment: WinXP, JBossAS 4.0.4GA_Patch1, JBCS Head as of July 31st, 2006.
>            Reporter: David Fuelling
>            Priority: Minor
>   Original Estimate: 5 minutes
>  Remaining Estimate: 5 minutes
>
> 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