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:
8948907
)
Fix access to invalid data on reception of packet with size 0
author
sapier
<Sapier at GMX dot net>
Sat, 6 Sep 2014 15:41:40 +0000
(17:41 +0200)
committer
sapier
<Sapier at GMX dot net>
Sat, 6 Sep 2014 15:42:34 +0000
(17:42 +0200)
src/connection.cpp
patch
|
blob
|
history
diff --git
a/src/connection.cpp
b/src/connection.cpp
index 2f9339e6ae2da5977f2b0dadfff2c46797b9df09..bd0d872caf5a3f08c00b7825e5746b2a3181d973 100644
(file)
--- a/
src/connection.cpp
+++ b/
src/connection.cpp
@@
-2143,7
+2143,9
@@
void ConnectionReceiveThread::receive()
LOG(derr_con<<m_connection->getDesc()
<<"Receive(): Invalid incoming packet, "
<<"size: " << received_size
- <<", protocol: " << readU32(&packetdata[0]) <<std::endl);
+ <<", protocol: "
+ << ((received_size >= 4) ? readU32(&packetdata[0]) : -1)
+ << std::endl);
continue;
}