From 87dcee6ac2058bbf5264ea7f82874bba67277252 Mon Sep 17 00:00:00 2001 From: gregorycu Date: Sun, 3 Jan 2016 18:25:09 +1100 Subject: [PATCH] Prevent technically unsafe access with empty vector --- src/network/networkpacket.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/network/networkpacket.cpp b/src/network/networkpacket.cpp index b5e451cdb..2b308f334 100644 --- a/src/network/networkpacket.cpp +++ b/src/network/networkpacket.cpp @@ -77,6 +77,9 @@ void NetworkPacket::putRawString(const char* src, u32 len) m_data.resize(m_datasize); } + if (m_datasize == 0) + return; + memcpy(&m_data[m_read_offset], src, len); m_read_offset += len; } -- 2.25.1