ppkarwasz commented on code in PR #1379:
URL: https://github.com/apache/commons-lang/pull/1379#discussion_r2085485496


##########
src/main/java/org/apache/commons/lang3/RandomStringUtils.java:
##########
@@ -97,6 +97,7 @@ public class RandomStringUtils {
     private static final int ASCII_9 = '9';
     private static final int ASCII_A = 'A';
     private static final int ASCII_z = 'z';
+    private static final int MAX_CACHE_SIZE = 60_000_000;

Review Comment:
   This value is also much lower than the value that makes `bitIndex` overflow. 
The first forbidden value is `2^28 = 268_435_456`, so values up to `0x1fff 
ffff` should be allowed.
   
   **Note**: The expression `(count * gapBits + 3) / 5 + 10` overflows if 
`count` exceeds `(2^31 - 1 - 3) / 21 = 102_261_125`.



-- 
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: issues-unsubscr...@commons.apache.org

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

Reply via email to