projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a7c50a3
)
Prevent technically unsafe access with empty vector
author
gregorycu
<gregory.currie@gmail.com>
Sun, 3 Jan 2016 07:25:09 +0000
(18:25 +1100)
committer
Loic Blot
<loic.blot@unix-experience.fr>
Sun, 3 Jan 2016 14:37:49 +0000
(15:37 +0100)
src/network/networkpacket.cpp
patch
|
blob
|
history
diff --git
a/src/network/networkpacket.cpp
b/src/network/networkpacket.cpp
index b5e451cdb0a0512146828952ce3b06f543dcf1ac..2b308f334e2f94211cd9e86d36bd833d9917724d 100644
(file)
--- 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;
}