aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--command.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/command.c b/command.c
index 4ace92b..1cd8619 100644
--- a/command.c
+++ b/command.c
@@ -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");