Re: Bug in MBOX classpathx

Chris Burdess <[email protected]>
Newsgroups gmane.comp.java.classpath.extensions.javamail
Message-ID <[email protected]>
Countach wrote:
> There is a bug in the MBOX reader such that it blows up if the Date 
> header has a trailing space and you call Message.getSentDate().
>
> The problem is in MailDateFormat.parse....
>
>       if (end != len)
>          {
>            // Timezone
>            start = skipWhitespace(text, end + 1);
>            end = start + 1;
>
> If it gets to this point it assumes I guess that there must be a 
> timezone if there is trailing whitespace. So it calls skipWhitespace, 
> the trouble is skipWhitespace doesn't check for end of String, it 
> keeps calling charAt(pos) until it runs off the end of the String.
>
> Is there someone more familiar with the code who would care to fix 
> this?

I've updated the code to handle trailing whitespace, if you have any 
problems as a result of the changes please let me know.
-- 
Chris Burdess
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.