diff --git a/src/crypto/crypto_ec.cc b/src/crypto/crypto_ec.cc index 7f1ba4dbff6036..2d738bb9b62e11 100644 --- a/src/crypto/crypto_ec.cc +++ b/src/crypto/crypto_ec.cc @@ -733,7 +733,11 @@ Maybe ExportJWKEcKey( BignumPointer x(BN_new()); BignumPointer y(BN_new()); - EC_POINT_get_affine_coordinates(group, pub, x.get(), y.get(), nullptr); + if (!EC_POINT_get_affine_coordinates(group, pub, x.get(), y.get(), nullptr)) { + ThrowCryptoError(env, ERR_get_error(), + "Failed to get elliptic-curve point coordinates"); + return Nothing(); + } if (target->Set( env->context(),