Skip to content

Commit

Permalink
Fix a read-from-end-of-buffer issue
Browse files Browse the repository at this point in the history
Fixes #94
  • Loading branch information
rprichard committed Oct 20, 2016
1 parent d02e42d commit 68c0c14
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/agent/NamedPipe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ size_t NamedPipe::peek(void *data, size_t size)
ASSERT(m_openMode & OpenMode::Reading);
const auto out = reinterpret_cast<char*>(data);
const size_t ret = std::min(size, m_inQueue.size());
std::copy(&m_inQueue[0], &m_inQueue[size], out);
std::copy(&m_inQueue[0], &m_inQueue[ret], out);
return ret;
}

Expand Down

0 comments on commit 68c0c14

Please sign in to comment.