pjfanning commented on code in PR #1064:
URL: https://github.com/apache/poi/pull/1064#discussion_r3225151609


##########
poi/src/main/java/org/apache/poi/hpsf/Array.java:
##########
@@ -71,7 +71,12 @@ void read( LittleEndianByteArrayInputStream lei ) {
         long getNumberOfScalarValues() {
             long result = 1;
             for ( ArrayDimension dimension : _dimensions ) {
-                result *= dimension._size;
+                try {
+                    result = Math.multiplyExact(result, dimension._size);
+                } catch (ArithmeticException e) {
+                    throw new IllegalPropertySetDataException(

Review Comment:
   
https://github.com/apache/poi/blob/7607d1bbeeef45f5bb2c7492e1c41d153dfa78ee/poi/src/main/java/org/apache/poi/hpsf/IllegalPropertySetDataException.java#L21-L26
   
   Where does this mention anything about IllegalPropertySetDataException being 
used for this type of exception?
   
   ArithmeticException would be a better choice. Or possibly a new dedicated 
exception.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to