diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index 1dcb1618ad1..a06db97cae2 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -135,7 +135,11 @@ var/charcount = 0 var/char = "" - + // This is a sanity short circuit, if the users name is three times the maximum allowable length of name + // We bail out on trying to process the name at all, as it could be a bug or malicious input and we dont + // Want to iterate all of it. + if(t_len > 3 * MAX_NAME_LEN) + return for(var/i = 1, i <= t_len, i += length(char)) char = t_in[i] switch(text2ascii(char))