LibCrypto: This method wrote to a const pointer.

This commit is contained in:
asynts 2020-07-27 14:37:30 +02:00 committed by Andreas Kling
parent 7f70a6f0cb
commit 68cf22d580
Notes: sideshowbarker 2024-07-19 04:33:08 +09:00
2 changed files with 4 additions and 2 deletions

View file

@ -67,8 +67,9 @@ public:
static SignedBigInteger import_data(const u8* ptr, size_t length);
size_t export_data(AK::ByteBuffer& data) const;
size_t export_data(const u8* ptr, size_t length) const
size_t export_data(u8* ptr, size_t length) const
{
// Note: ByteBuffer::wrap() does a const_cast!
auto buffer = ByteBuffer::wrap(ptr, length);
return export_data(buffer);
}

View file

@ -59,8 +59,9 @@ public:
}
size_t export_data(AK::ByteBuffer& data) const;
size_t export_data(const u8* ptr, size_t length) const
size_t export_data(u8* ptr, size_t length) const
{
// Note: ByteBuffer::wrap() does a const_cast!
auto buffer = ByteBuffer::wrap(ptr, length);
return export_data(buffer);
}