You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apex.apache.org by "songwanging (JIRA)" <ji...@apache.org> on 2017/12/08 15:53:00 UTC

[jira] [Created] (APEXMALHAR-2551) Potential Integer Overflow

songwanging created APEXMALHAR-2551:
---------------------------------------

             Summary: Potential Integer Overflow
                 Key: APEXMALHAR-2551
                 URL: https://issues.apache.org/jira/browse/APEXMALHAR-2551
             Project: Apache Apex Malhar
          Issue Type: Bug
    Affects Versions: 3.8.0
            Reporter: songwanging
            Priority: Minor


Our tool DeepTect has detected a potential integer overflow:
Path: apex-malhar/library/src/main/java/com/datatorrent/lib/io/fs/Synchronizer.java

{code:java}
long bytesRemainingToRead = length;
int bytesToread = Math.min(BUFFER_SIZE, (int)bytesRemainingToRead);
{code}

In the above code snippet, "bytesRemainingToRead " is a long variable, if it is super large, directly casting "bytesRemainingToRead" into integer will definitely lead to a potential integer overflow.



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