From 1033f94d24fb397f0c3809ecdc69426f8dd639bf Mon Sep 17 00:00:00 2001 From: "simon.kagstrom" Date: Sun, 8 Nov 2009 09:34:00 +0000 Subject: [PATCH] Check that the network magic is correct --- Src/Network.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Src/Network.cpp b/Src/Network.cpp index b0b5dc0..c1ef9ad 100644 --- a/Src/Network.cpp +++ b/Src/Network.cpp @@ -565,6 +565,10 @@ bool Network::ReceiveUpdate(NetworkUpdate *dst, size_t total_sz, return false; received += actual_sz; + if (ntohs(dst->magic) != FRODO_NETWORK_MAGIC) { + printf("Packet with wrong magic received\n"); + return false; + } if (this->ScanDataForStop(dst, received) == true) break;