From 59c4a342a9625fe37e9a7aa755e6deca14c3a110 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Tue, 3 May 2011 17:33:51 +0300 Subject: Fixed a temporary solution of server shutting down to an assert(0) when a too large block metadata is sent to an old client --- src/utility.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/utility.h') diff --git a/src/utility.h b/src/utility.h index 5cb3080a7..12d732bea 100644 --- a/src/utility.h +++ b/src/utility.h @@ -1911,7 +1911,9 @@ inline v3f intToFloat(v3s16 p, f32 d) // Creates a string with the length as the first two bytes inline std::string serializeString(const std::string &plain) { - assert(plain.size() <= 65535); + //assert(plain.size() <= 65535); + if(plain.size() > 65535) + throw SerializationError("String too long for serializeString"); char buf[2]; writeU16((u8*)&buf[0], plain.size()); std::string s; -- cgit v1.2.3