On Mon, 23 Nov 2026 09:06:17 GMT, Matthias Baesken <[email protected]> wrote:
>> We miss a couple of CFRelease calls in >> Java_apple_security_KeychainStore__1addItemToKeychain in case of early >> errors/returns. >> Also a NULL check after CFDataCreate is recommended. >> See >> https://developer.apple.com/documentation/corefoundation/cfdatacreate(_:_:_:) >> about return value and ownership/Create rule. >> >> --------- >> - [x] I confirm that I make this contribution in accordance with the >> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). > > Matthias Baesken has updated the pull request incrementally with one > additional commit since the last revision: > > Move pw code up I was talking about the password-related lines you have moved in the last commit. When `goto errOut` is called on line 776, it is before `rawData`'s declaration and assignment. Since the code compiles, I assume it is treated in scope, but the assignment still happens after it. If we jump on line 776, `if (rawData)` causes undefined behavior. Now, `passwordStrRef` and `passwordChars` are already before all goto calls. It's `rawData` that needs the move. ------------- PR Comment: https://git.openjdk.org/jdk/pull/33999#issuecomment-7112656909
