james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niklas Therning (JIRA)" <server-...@james.apache.org>
Subject [jira] Commented: (MIME4J-49) Message or body part with empty header causes infinite loop
Date Fri, 11 Jul 2008 07:47:31 GMT

    [ https://issues.apache.org/jira/browse/MIME4J-49?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12612787#action_12612787
] 

Niklas Therning commented on MIME4J-49:
---------------------------------------

This very simple patch seems to fix this problem. Should I check this in?

Index: src/main/java/org/apache/james/mime4j/AbstractEntity.java
===================================================================
--- src/main/java/org/apache/james/mime4j/AbstractEntity.java	(revision 675691)
+++ src/main/java/org/apache/james/mime4j/AbstractEntity.java	(working copy)
@@ -163,6 +163,9 @@
             
             // Strip away line delimiter
             int len = fieldbuf.length();
+            if (len == 0 && endOfHeader) {
+                return false;
+            }
             if (len > 0 && fieldbuf.charAt(len - 1) == '\n') {
                 len--;
             }


> Message or body part with empty header causes infinite loop
> -----------------------------------------------------------
>
>                 Key: MIME4J-49
>                 URL: https://issues.apache.org/jira/browse/MIME4J-49
>             Project: Mime4j
>          Issue Type: Bug
>    Affects Versions: 0.4
>            Reporter: Niklas Therning
>             Fix For: 0.4
>
>
> If a message or body part contains an empty header the parser will loop indefinitely
(when in non-strict mode). Seems like qmail sometimes sends out failure notices which have
body parts with empty headers.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message