Index: crypto/ec_private_key.cc |
diff --git a/crypto/ec_private_key.cc b/crypto/ec_private_key.cc |
index 9914c5dde866e9f2e47b9a747ab7584cefff4d19..08fd75dec3c95f74bb381c082e8000dc7f02fa28 100644 |
--- a/crypto/ec_private_key.cc |
+++ b/crypto/ec_private_key.cc |
@@ -46,9 +46,9 @@ bool ExportKeyWithBio(const void* key, |
if (!export_fn(bio.get(), key)) |
return false; |
- char* data = nullptr; |
- long len = BIO_get_mem_data(bio.get(), &data); |
- if (!data || len < 0) |
+ const uint8_t* data; |
+ size_t len; |
+ if (!BIO_mem_contents(bio.get(), &data, &len)) |
return false; |
output->assign(data, data + len); |