TehGimp / KerbalMultiPlayer

A multiplayer plugin for KMP
http://sesau.ca/ksp/KMP.html
GNU General Public License v3.0
140 stars 53 forks source link

Profanity filter crash #660

Closed TehGimp closed 10 years ago

TehGimp commented 10 years ago

Reported via email:

Well... The error occurs when someone sends a message in the chat [Error] : at KMPServer.ServerSettings.ConfigStore.m__23(String ws) at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext() at KMPServer.Server.WashMouthWithSoap(String message_text) at KMPServer.Server.handleClientTextMessage(Client cl, String message_text) at KMPServer.Server.handleMessage(Client cl, ClientMessageID id, Byte[] data) at KMPServer.Server.handleConnections() There's the section of the log that contains the error.

Most likely a malformed profanity filter setting that's responsible.

nevercast commented 10 years ago

Though the actual error isn't printed, I'm going to imagine it's an index out of bounds as the indices are not checked inside the LINQ statement.

godarklight commented 10 years ago

This is exactly as gimp suspected, adding ',crash' (or anything after the comma without a : mark) to the end of the filter will cause the server to fully crash in the WashMouthWithSoap method.

We probably should validate the filter and reset it to the default if it's mangled, with an appropriate warning displayed.

EDIT: Or ignore bad entries, but still give a warning.

nevercast commented 10 years ago

Hmm strange that it doesn't invoke the try catch

nevercast commented 10 years ago

I'm thinking it's a differed execution issue. Going to change the LINQ a bit.