diff --git a/lib/base/netstring.cpp b/lib/base/netstring.cpp index 9de181e26..1d97836af 100644 --- a/lib/base/netstring.cpp +++ b/lib/base/netstring.cpp @@ -86,14 +86,14 @@ StreamReadStatus NetString::ReadStringFromStream(const Stream::Ptr& stream, Stri char *data = context.Buffer + header_length + 1; - if (context.Size < header_length + 1 + len + 1) { + if (context.Size < header_length + 1 + data_length) { context.MustRead = true; return StatusNeedData; } if (data[len] != ',') BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid NetString (missing ,)")); - + *str = String(&data[0], &data[len]); context.DropData(header_length + 1 + len + 1); diff --git a/lib/base/streamlogger.cpp b/lib/base/streamlogger.cpp index af04e06bc..d3b0ca8a9 100644 --- a/lib/base/streamlogger.cpp +++ b/lib/base/streamlogger.cpp @@ -33,7 +33,7 @@ boost::mutex StreamLogger::m_Mutex; * Constructor for the StreamLogger class. */ StreamLogger::StreamLogger(void) - : m_Stream(NULL), m_OwnsStream(false), m_Tty(false) + : m_Stream(NULL), m_OwnsStream(false) { } void StreamLogger::Stop(void) diff --git a/lib/base/streamlogger.hpp b/lib/base/streamlogger.hpp index 76976c7ae..9ab84127a 100644 --- a/lib/base/streamlogger.hpp +++ b/lib/base/streamlogger.hpp @@ -55,7 +55,6 @@ private: static boost::mutex m_Mutex; std::ostream *m_Stream; bool m_OwnsStream; - bool m_Tty; Timer::Ptr m_FlushLogTimer;