Permalink
Browse files

websocket: use memcpy instead of strncpy if there can be \0 values in…

… the copied buffer (fixes #12995)
  • Loading branch information...
1 parent fccca03 commit b8a3e19185fee39380b080f7e91a1e1c3dbf3a5b @Montellese Montellese committed May 12, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 xbmc/network/websocket/WebSocket.cpp
@@ -232,7 +232,7 @@ CWebSocketFrame::CWebSocketFrame(WebSocketFrameOpcode opcode, const char* data /
// Get the whole data
m_lengthFrame = buffer.size();
m_data = new char[(uint32_t)m_lengthFrame];
- strncpy((char *)m_data, buffer.c_str(), (uint32_t)m_lengthFrame);
+ memcpy((char *)m_data, buffer.c_str(), (uint32_t)m_lengthFrame);
if (data)
{

0 comments on commit b8a3e19

Please sign in to comment.