You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2021/03/02 02:26:14 UTC

[GitHub] [commons-imaging] kinow opened a new pull request #122: [IMAGING-279] Protect against NegativeArraySizeException in BinaryFunctions.readBytes and BinaryFunctions.getRAFBytes

kinow opened a new pull request #122:
URL: https://github.com/apache/commons-imaging/pull/122


   The function receives a `length` parameter that can be either hard-coded in the caller function, or be retrieved from an image that is being parsed.
   
   If the latter, then the image could contain invalid data, such as values that overflow, or negative values. If the values provided are negative, then `new byte[-1]` or equivalent would raise a `NegativeArraySizeException` as reported in the JIRA issue.
   
   This pull request simply prevents that from happening by raising an `IOEXception` (as in other parts of the `BinaryFunctions` code).
   
   That way the `BmpImageParser` and the rest of the code would be safe from the runtime `NegativeArraySizeException`.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [commons-imaging] coveralls commented on pull request #122: [IMAGING-279] Protect against NegativeArraySizeException in BinaryFunctions.readBytes and BinaryFunctions.getRAFBytes

Posted by GitBox <gi...@apache.org>.
coveralls commented on pull request #122:
URL: https://github.com/apache/commons-imaging/pull/122#issuecomment-788529220


   
   [![Coverage Status](https://coveralls.io/builds/37561045/badge)](https://coveralls.io/builds/37561045)
   
   Coverage decreased (-0.006%) to 76.439% when pulling **070cc627f4e6d61913dc52d2caef798532d7da41 on kinow:IMAGING-279** into **aa84b538d1c7f4fa5be1565ac18a29ff0d77345d on apache:master**.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [commons-imaging] kinow merged pull request #122: [IMAGING-279] Protect against NegativeArraySizeException in BinaryFunctions.readBytes and BinaryFunctions.getRAFBytes

Posted by GitBox <gi...@apache.org>.
kinow merged pull request #122:
URL: https://github.com/apache/commons-imaging/pull/122


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org