kafka-jira mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ted Yu (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (KAFKA-5863) Potential null dereference in DistributedHerder#reconfigureConnector()
Date Wed, 20 Sep 2017 01:36:00 GMT

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

Ted Yu updated KAFKA-5863:
--------------------------
    Description: 
Here is the call chain:

{code}
                                RestServer.httpRequest(reconfigUrl, "POST", taskProps, null);
{code}
In httpRequest():
{code}
            } else if (responseCode >= 200 && responseCode < 300) {
                InputStream is = connection.getInputStream();
                T result = JSON_SERDE.readValue(is, responseFormat);
{code}
For readValue():
{code}
    public <T> T readValue(InputStream src, TypeReference valueTypeRef)
        throws IOException, JsonParseException, JsonMappingException
    {
        return (T) _readMapAndClose(_jsonFactory.createParser(src), _typeFactory.constructType(valueTypeRef));
{code}
Then there would be NPE in constructType():
{code}
    public JavaType constructType(TypeReference<?> typeRef)
    {
        // 19-Oct-2015, tatu: Simpler variant like so should work
        return _fromAny(null, typeRef.getType(), EMPTY_BINDINGS);
{code}

  was:
Here is the call chain:
{code}
                                RestServer.httpRequest(reconfigUrl, "POST", taskProps, null);
{code}
In httpRequest():
{code}
            } else if (responseCode >= 200 && responseCode < 300) {
                InputStream is = connection.getInputStream();
                T result = JSON_SERDE.readValue(is, responseFormat);
{code}
For readValue():
{code}
    public <T> T readValue(InputStream src, TypeReference valueTypeRef)
        throws IOException, JsonParseException, JsonMappingException
    {
        return (T) _readMapAndClose(_jsonFactory.createParser(src), _typeFactory.constructType(valueTypeRef));
{code}
Then there would be NPE in constructType():
{code}
    public JavaType constructType(TypeReference<?> typeRef)
    {
        // 19-Oct-2015, tatu: Simpler variant like so should work
        return _fromAny(null, typeRef.getType(), EMPTY_BINDINGS);
{code}


> Potential null dereference in DistributedHerder#reconfigureConnector()
> ----------------------------------------------------------------------
>
>                 Key: KAFKA-5863
>                 URL: https://issues.apache.org/jira/browse/KAFKA-5863
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Priority: Minor
>
> Here is the call chain:
> {code}
>                                 RestServer.httpRequest(reconfigUrl, "POST", taskProps,
null);
> {code}
> In httpRequest():
> {code}
>             } else if (responseCode >= 200 && responseCode < 300) {
>                 InputStream is = connection.getInputStream();
>                 T result = JSON_SERDE.readValue(is, responseFormat);
> {code}
> For readValue():
> {code}
>     public <T> T readValue(InputStream src, TypeReference valueTypeRef)
>         throws IOException, JsonParseException, JsonMappingException
>     {
>         return (T) _readMapAndClose(_jsonFactory.createParser(src), _typeFactory.constructType(valueTypeRef));
> {code}
> Then there would be NPE in constructType():
> {code}
>     public JavaType constructType(TypeReference<?> typeRef)
>     {
>         // 19-Oct-2015, tatu: Simpler variant like so should work
>         return _fromAny(null, typeRef.getType(), EMPTY_BINDINGS);
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message