DynamicDNS: Fix a crash when increasing the number of services

This commit is contained in:
Amin Ben Ramdhane 2022-09-22 09:44:07 +01:00
parent fdc76219da
commit 942b7251dd

View file

@ -41,7 +41,7 @@ static void update_supported_services(void)
{
struct uci_section *s = NULL;
char *service_name = NULL;
char supported_services[1024] = {0};
char supported_services[2048] = {0};
unsigned pos = 0;
supported_services[0] = 0;
@ -49,6 +49,9 @@ static void update_supported_services(void)
uci_path_foreach_sections(bbfdm, "dmmap_ddns", "server", s) {
dmuci_get_value_by_section_string(s, "service_name", &service_name);
if ((sizeof(supported_services) - pos) < DM_STRLEN(service_name))
break;
pos += snprintf(&supported_services[pos], sizeof(supported_services) - pos, "%s,", service_name);
}