From 85ad5f4602530471df315db6d981678874bcd32e Mon Sep 17 00:00:00 2001 From: Andre Pinto Date: Wed, 8 Nov 2017 08:30:36 -0800 Subject: [PATCH] Avoid implicitly dropping const modifier Summary: Use const_cast instead of implicitly dropping const modifier. Reviewed By: reanimus Differential Revision: D6269200 fbshipit-source-id: 61e1708c88a4139d3fdd9cf89f4ff778d0354bb2 --- folly/ssl/OpenSSLCertUtils.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/folly/ssl/OpenSSLCertUtils.cpp b/folly/ssl/OpenSSLCertUtils.cpp index f7397631..9b9efa3e 100644 --- a/folly/ssl/OpenSSLCertUtils.cpp +++ b/folly/ssl/OpenSSLCertUtils.cpp @@ -199,7 +199,8 @@ std::unique_ptr OpenSSLCertUtils::derEncode(X509& x509) { std::vector OpenSSLCertUtils::readCertsFromBuffer( ByteRange range) { - BioUniquePtr b(BIO_new_mem_buf(range.data(), range.size())); + BioUniquePtr b( + BIO_new_mem_buf(const_cast(range.data()), range.size())); if (!b) { throw std::runtime_error("failed to create BIO"); } -- 2.34.1