Commit 72a6c827 authored by Michal Hrusecky's avatar Michal Hrusecky 🦎

Fix buffer overflow and increase the network interfaces limit

Thanks to James Marsh for figuring it out.
parent 76fd6a1b
......@@ -18,7 +18,7 @@
#define FS_CMD "df"
#define MAX_LEN_INTERFACE_NAME 20
#define MAX_LEN_INTERFACE_LIST 20
#define MAX_LEN_INTERFACE_LIST 80
#define MAX_LEN_FS 20
/*
......@@ -159,6 +159,8 @@ static bool network_init_global() {
newlen = strlen(name) - 1;
name[newlen] = '\0';
memcpy(g_config.network.interfaces[g_config.network.interfaces_cnt++], name, newlen);
if(g_config.network.interfaces_cnt > MAX_LEN_INTERFACE_LIST)
break;
}
fclose(f);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment