Преглед изворни кода

Merge pull request #1001 from secretdataz/fix/message

Fixed chat message that already have zero termination being misinterpreted as corrupted packets.
This issue was reported on #1000 by @secretdataz and was on clients from 2015-10-01 onwards and was mainly caused by Frost Joke.

Thanks to @secretdataz for additionally providing a fix for it in this pull request too.
Lemongrass3110 пре 9 година
родитељ
комит
fb4cf3e5e3
1 измењених фајлова са 4 додато и 1 уклоњено
  1. 4 1
      src/map/clif.c

+ 4 - 1
src/map/clif.c

@@ -9803,7 +9803,10 @@ static bool clif_process_message(struct map_session_data* sd, int format, char**
 	}
 
 #if PACKETVER >= 20151001
-	message[messagelen++] = '\0';
+	if (message[messagelen-1] != '\0')
+	{
+		message[messagelen++] = '\0';
+	}
 #endif
 
 	// the declared length must match real length