From b015c8c3a85860ce011a6e497ba5076ed8be4232 Mon Sep 17 00:00:00 2001 From: Aaron Balsara Date: Fri, 15 Jan 2016 12:02:40 -0800 Subject: [PATCH] Fix buck build for SSLContext Summary: D2800746 broke buck with an unsigned/signed compare Reviewed By: dkgi Differential Revision: D2835102 fb-gh-sync-id: a0b8311b38a199e089d3ed5a69b12f8f8abe38b1 --- folly/io/async/SSLContext.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/folly/io/async/SSLContext.cpp b/folly/io/async/SSLContext.cpp index eb5f122a..4d2dfed0 100644 --- a/folly/io/async/SSLContext.cpp +++ b/folly/io/async/SSLContext.cpp @@ -204,7 +204,7 @@ void SSLContext::loadCertificateFromBufferPEM(folly::StringPiece cert) { } int written = BIO_write(bio.get(), cert.data(), cert.size()); - if (written != cert.size()) { + if (written <= 0 || static_cast(written) != cert.size()) { throw std::runtime_error("BIO_write: " + getErrors()); } @@ -244,7 +244,7 @@ void SSLContext::loadPrivateKeyFromBufferPEM(folly::StringPiece pkey) { } int written = BIO_write(bio.get(), pkey.data(), pkey.size()); - if (written != pkey.size()) { + if (written <= 0 || static_cast(written) != pkey.size()) { throw std::runtime_error("BIO_write: " + getErrors()); } -- 2.34.1