Russole opened a new pull request, #10347: URL: https://github.com/apache/ozone/pull/10347
## What changes were proposed in this pull request? * Replace `StandardCharsets.UTF_8.decode(...)` in `OmMultipartPartKey` with `StringCodec` for decoding the persisted upload ID bytes. * The round-trip UTF-8 validation is needed because `StringCodecBase.decode(...)` catches strict decoding exceptions and falls back to compatibility decoding, which may use replacement characters. Re-encoding the decoded upload ID and comparing it with the original bytes lets us detect non-lossless decoding and reject malformed UTF-8 input. * Add a unit test to verify malformed UTF-8 upload IDs throw `IllegalArgumentException`. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-15348 ## How was this patch tested? - Added/updated unit test: - `TestOmMultipartPartKey#testDecodeRejectsMalformedUtf8UploadId` - Ran locally: - `mvn -pl :ozone-common -Dtest=TestOmMultipartPartKey test` - All CI checks passed - https://github.com/Russole/ozone/actions/runs/26320555387 -- 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]
