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] [Updated] (MIME4J-258) A potential NPE
Date Fri, 23 Dec 2016 01:10:58 GMT

     [ https://issues.apache.org/jira/browse/MIME4J-258?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jaechang Nam updated MIME4J-258:
--------------------------------
    Description: 
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 mirror 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}

  was:
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}


> 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 mirror 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