--- deliantra/server/socket/lowlevel.C 2007/09/01 08:03:46 1.57 +++ deliantra/server/socket/lowlevel.C 2007/09/30 20:22:25 1.59 @@ -489,7 +489,15 @@ void client::send_msg (int color, const char *type, const char *msg) { - if (msg_is_special (msg) || (type [0] == 'c' && type [1] == '/')) + if (!msg || !type) // it can happen (for example, missing attack messages cause this) + { + LOG (logBacktrace | llevError, "send_msg(%d,%p,%p) called with NULL msg or type.\n", color, type, msg); + return; + } + + int len = strlen (msg); + + if (msg_is_special (msg) || (type [0] == 'c' && type [1] == '/') || len > (MAXSOCKBUF - 128)) cfperl_send_msg (this, color, type, msg); else if (can_msg) send_packet_printf ("msg %d %s %s", color & NDI_CLIENT_MASK, type, msg);