Validate input parameters and enhance error handling in configuration loading, task queue management, SSL initialization, and WebSocket handshake processes.

This commit is contained in:
2025-10-31 16:10:00 +01:00
parent 72df6a73fc
commit 2fc7edf37d
4 changed files with 51 additions and 10 deletions

View File

@@ -93,6 +93,12 @@ static ConfigKey get_config_key(const char *key)
int load_config(const char *filename, ServerConfig *config)
{
if (!filename || strlen(filename) > 4096)
{
fprintf(stderr, "Invalid config filename\n");
return 1;
}
FILE *fp = fopen(filename, "r");
if (!fp)
{