• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

This is a fork of Zandronum used on servers hosted by The Sentinels Playground (TSPG).


Commit MetaInfo

Revisionb9a1f917b4bf2a16a13609908d38c8c215e6d76d (tree)
Time2021-11-07 13:25:15
AuthorAdam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Log Message

Make sure we've read the entire byte stream of a CLC_SAY command before making any important checks. Also added a check so that clients can't maliciously send private messages to themselves.

Change Summary

Incremental Difference

diff -r e78afec5d491 -r b9a1f917b4bf src/sv_main.cpp
--- a/src/sv_main.cpp Fri Nov 05 18:54:13 2021 -0400
+++ b/src/sv_main.cpp Sun Nov 07 00:25:15 2021 -0400
@@ -5715,6 +5715,12 @@
57155715
57165716 // [AK] If we're sending a private message to a player, get their index number.
57175717 if ( ulChatMode == CHATMODE_PRIVATE_SEND )
5718+ ulReceiver = pByteStream->ReadByte();
5719+
5720+ // Read in the chat string.
5721+ const char *pszChatString = pByteStream->ReadString();
5722+
5723+ if ( ulChatMode == CHATMODE_PRIVATE_SEND )
57185724 {
57195725 // [AK] Don't send the message if we disabled private messaging.
57205726 if ( zadmflags & ZADF_NO_PRIVATE_CHAT )
@@ -5723,11 +5729,13 @@
57235729 return ( false );
57245730 }
57255731
5726- ulReceiver = pByteStream->ReadByte();
5727- }
5728-
5729- // Read in the chat string.
5730- const char *pszChatString = pByteStream->ReadString();
5732+ // [AK] Don't let the client send a private message to themselves.
5733+ if ( ulPlayer == ulReceiver )
5734+ {
5735+ SERVER_PrintfPlayer( ulPlayer, "You can't send private messages to yourself.\n" );
5736+ return ( false );
5737+ }
5738+ }
57315739
57325740 // [BB] If the client is flooding the server with commands, the client is
57335741 // kicked and we don't need to handle the command.