mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 12:09:14 +00:00
8358316: PKCS8Key.getEncoded() can throw NPE after JDK-8298420
Reviewed-by: ascarpino
This commit is contained in:
parent
be923a8b72
commit
cff75eb606
@ -256,7 +256,8 @@ public class PKCS8Key implements PrivateKey, InternalPrivateKey {
|
||||
* or {@code null} if an encoding error occurs.
|
||||
*/
|
||||
public byte[] getEncoded() {
|
||||
return getEncodedInternal().clone();
|
||||
byte[] b = getEncodedInternal();
|
||||
return (b != null) ? b.clone() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user