From: Pieter Lexis Date: Thu, 25 Feb 2016 11:48:48 +0000 (+0100) Subject: Silence a BIO_write warning X-Git-Tag: auth-4.0.0-alpha2^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F3453%2Fhead;p=thirdparty%2Fpdns.git Silence a BIO_write warning --- diff --git a/pdns/base64.cc b/pdns/base64.cc index 6a0ca12f68..9575b1c090 100644 --- a/pdns/base64.cc +++ b/pdns/base64.cc @@ -44,7 +44,8 @@ std::string Base64Encode(const std::string& src) bio = BIO_new(BIO_s_mem()); bio = BIO_push(b64, bio); BIO_set_flags(bio, BIO_FLAGS_BASE64_NO_NL); - if (BIO_write(bio, src.c_str(), src.length()) != src.length()) { + int bioWriteRet = BIO_write(bio, src.c_str(), src.length()); + if (bioWriteRet < 0 || (size_t) bioWriteRet != src.length()) { BIO_free_all(bio); throw std::runtime_error("BIO_write failed to write all data to memory buffer"); }