ocserv-main should limit the maximum message size a client can send

Resolves: #244

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
This commit is contained in:
Alan Jowett
2020-02-14 08:58:40 -07:00
parent 9bd3c136e1
commit f410a5c637

View File

@@ -256,6 +256,13 @@ int handle_worker_commands(main_server_st * s, struct proc_st *proc)
length = ret; length = ret;
if (length > MAX_MSG_SIZE) {
mslog(s, proc, LOG_DEBUG,
"received too big message (%d)", (int)length);
ret = ERR_BAD_COMMAND;
return ret;
}
mslog(s, proc, LOG_DEBUG, "main received worker's message '%s' of %u bytes\n", mslog(s, proc, LOG_DEBUG, "main received worker's message '%s' of %u bytes\n",
cmd_request_to_str(cmd), (unsigned)length); cmd_request_to_str(cmd), (unsigned)length);