Ted Yu created FLINK-3104:
-----------------------------

             Summary: Potential null dereference of outStream in 
FsStateBackend#CheckpointStateOutputStream#closeAndGetHandle()
                 Key: FLINK-3104
                 URL: https://issues.apache.org/jira/browse/FLINK-3104
             Project: Flink
          Issue Type: Bug
            Reporter: Ted Yu
            Priority: Minor


Here is related code:
{code}
          if (outStream == null && pos <= localStateThreshold) {
            closed = true;
            byte[] bytes = Arrays.copyOf(writeBuffer, pos);
            return new ByteStreamStateHandle(bytes);
          }
          else {
            flush();
            outStream.close();
{code}
The if condition checks both outStream and pos.
In the else block, outStream may be null, leading to NPE.



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

Reply via email to