]> granicus.if.org Git - icinga2/commitdiff
fixup errbuf length in the other files and avoid using the static buffer in one place... 7172/head
authorElias Ohm <eohm@novomind.com>
Thu, 9 May 2019 07:30:12 +0000 (09:30 +0200)
committerElias Ohm <eohm@novomind.com>
Thu, 9 May 2019 07:30:12 +0000 (09:30 +0200)
lib/base/tlsstream.cpp
lib/remote/pkiutility.cpp

index 5f6fe33cf908594644d0a4a6b291d58d5bc5881c..210d88002988d8d5a3ec561ecc2e8e98906edbab 100644 (file)
@@ -61,7 +61,7 @@ TlsStream::TlsStream(const Socket::Ptr& socket, const String& hostname, Connecti
        m_CurrentAction(TlsActionNone), m_Retry(false), m_Shutdown(false)
 {
        std::ostringstream msgbuf;
-       char errbuf[120];
+       char errbuf[256];
 
        m_SSL = std::shared_ptr<SSL>(SSL_new(sslContext), SSL_free);
 
@@ -272,8 +272,9 @@ void TlsStream::OnEvent(int revents)
                                m_ErrorOccurred = true;
 
                                if (m_ErrorCode != 0) {
+                                       char errbuf[256];
                                        Log(LogWarning, "TlsStream")
-                                               << "OpenSSL error: " << ERR_error_string(m_ErrorCode, nullptr);
+                                               << "OpenSSL error: " << ERR_error_string(m_ErrorCode, errbuf);
                                } else {
                                        Log(LogWarning, "TlsStream", "TLS stream was disconnected.");
                                }
index c08989dd8a98a065da1ba00be794f0a9689492e8..350b993619c0ca8a89479769512be106a456997d 100644 (file)
@@ -53,7 +53,7 @@ int PkiUtility::NewCert(const String& cn, const String& keyfile, const String& c
 
 int PkiUtility::SignCsr(const String& csrfile, const String& certfile)
 {
-       char errbuf[120];
+       char errbuf[256];
 
        InitializeOpenSSL();