pjfanning opened a new pull request, #1480:
URL: https://github.com/apache/poi/pull/1480

   Follow-up to #1478.
   
   `spinCount` on `sheetProtection`/`workbookProtection` is an 
`xsd:unsignedInt`, but `XSSFPasswordHelper.validatePassword` parsed it with 
`Integer.parseInt`. A value above `Integer.MAX_VALUE` (e.g. `4294967295`) 
therefore threw `NumberFormatException` rather than the 
`EncryptedDocumentException` that #1478 introduced for out-of-range spin counts.
   
   - Parse as a `long`, then apply the existing range check against 
`AgileEncryptionVerifier.getMaxSpinCount()`.
   - A non-numeric `spinCount` now throws `EncryptedDocumentException` (with 
the `NumberFormatException` as cause) instead of a bare `NumberFormatException`.
   - New tests `TestXSSFSheet.protectSheet_spinCountAboveIntRange` and 
`protectSheet_spinCountNotANumber`.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


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