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: [email protected]
