diff options
author | asynts <asynts@gmail.com> | 2020-07-27 14:37:30 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-27 19:58:09 +0200 |
commit | 68cf22d580a91885bc97a8ecca8a37eb31237e50 (patch) | |
tree | 0bcaad2a85daadaf421c94354458c4791cc74450 | |
parent | 7f70a6f0cbeff93c59e86885ed9b40711753b5d2 (diff) | |
download | serenity-68cf22d580a91885bc97a8ecca8a37eb31237e50.zip |
LibCrypto: This method wrote to a const pointer.
-rw-r--r-- | Libraries/LibCrypto/BigInt/SignedBigInteger.h | 3 | ||||
-rw-r--r-- | Libraries/LibCrypto/BigInt/UnsignedBigInteger.h | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/Libraries/LibCrypto/BigInt/SignedBigInteger.h b/Libraries/LibCrypto/BigInt/SignedBigInteger.h index 1ff220daa1..b76ed51c2d 100644 --- a/Libraries/LibCrypto/BigInt/SignedBigInteger.h +++ b/Libraries/LibCrypto/BigInt/SignedBigInteger.h @@ -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); } diff --git a/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h b/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h index b63409543f..b4e995e602 100644 --- a/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h +++ b/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h @@ -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); } |