From: Aaron Balsara Date: Fri, 15 Jan 2016 20:02:40 +0000 (-0800) Subject: Fix buck build for SSLContext X-Git-Tag: deprecate-dynamic-initializer~153 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=b015c8c3a85860ce011a6e497ba5076ed8be4232;p=folly.git 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 --- 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()); }