james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jaechang Nam (JIRA)" <mime4j-...@james.apache.org>
Subject [jira] [Created] (MIME4J-258) A potential NPE
Date Fri, 23 Dec 2016 01:07:58 GMT
Jaechang Nam created MIME4J-258:
-----------------------------------

             Summary: A potential NPE
                 Key: MIME4J-258
                 URL: https://issues.apache.org/jira/browse/MIME4J-258
             Project: James Mime4j
          Issue Type: Bug
          Components: dom
            Reporter: Jaechang Nam
            Priority: Trivial


In dom/src/main/java/org/apache/james/mime4j/field/Fields.java, the conditions in return statement
may cause NPE when 'parameters' is null. (found a current github snapshot as of cb48082fb7cbbfb111c926cc8ae953d7261c235c)


{code}
157     public static ContentTypeField contentType(String mimeType, NameValuePair... parameters)
{
158         return contentType(mimeType, parameters != null || parameters.length == 0 ? Arrays.asList(parameters)
: null);
159     }
{code}

Intended this?
{code}
158         return contentType(mimeType, parameters != null? Arrays.asList(parameters) : null);
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message