diff options
Diffstat (limited to 'command.c')
-rw-r--r-- | command.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -16,6 +16,9 @@ #include "util.h" +#define MAX_MESSAGE_LEN 10000 + + struct cmd_retval{ bool socket_close; bool memzero; @@ -229,6 +232,10 @@ static struct cmd_retval cmd_send(struct conn_data *data,const char *tag,const c userdata_mark_active(data->userid,data->fd,true); const char *roomname=args[0]; const char *message=args[1]; + if(strlen(message)>MAX_MESSAGE_LEN){ + net_send_error(data->fd,tag,"Message too long"); + return RET_OK; + } i64 roomid=db_find_room(roomname); if(roomid==-1){ net_send_error(data->fd,tag,"Room not found"); |