Everywhere: Make ByteBuffer::bytes() lvalue-only

This helps prevent us from accidentally using pointers to the underlying
memory of temporary `ByteBuffer` values.
This commit is contained in:
Aliaksandr Kalenik
2025-12-10 10:32:02 +01:00
committed by Tim Flynn
parent 420187ba7c
commit 55e6e6f117
Notes: github-actions[bot] 2025-12-10 12:44:24 +00:00
6 changed files with 19 additions and 12 deletions

View File

@@ -4420,7 +4420,7 @@ WebIDL::ExceptionOr<GC::Ref<CryptoKey>> ECDSA::import_key(AlgorithmParams const&
// The uncompressed point format MUST be supported.
// 2. If the implementation does not support the compressed point format and a compressed point is provided, throw a DataError.
// 3. If a decode error occurs or an identity point is found, throw a DataError.
auto maybe_public_key = ::Crypto::PK::EC::parse_ec_key(move(key_bytes), false, {});
auto maybe_public_key = ::Crypto::PK::EC::parse_ec_key(key_bytes, false, {});
if (maybe_public_key.is_error())
return WebIDL::DataError::create(m_realm, "Failed to parse key"_utf16);
@@ -5372,7 +5372,7 @@ WebIDL::ExceptionOr<GC::Ref<CryptoKey>> ECDH::import_key(AlgorithmParams const&
// The uncompressed point format MUST be supported.
// 2. If the implementation does not support the compressed point format and a compressed point is provided, throw a DataError.
// 3. If a decode error occurs or an identity point is found, throw a DataError.
auto maybe_public_key = ::Crypto::PK::EC::parse_ec_key(move(key_bytes), false, {});
auto maybe_public_key = ::Crypto::PK::EC::parse_ec_key(key_bytes, false, {});
if (maybe_public_key.is_error())
return WebIDL::DataError::create(m_realm, "Failed to parse key"_utf16);