Fix crash in config parsing with too many servers

This commit is contained in:
Miroslav Lichvar 2013-04-26 14:17:21 +02:00
parent 6eafff2450
commit 0655def57f

3
conf.c
View file

@ -395,6 +395,9 @@ parse_source(const char *line, NTP_Source_Type type)
{ {
CPS_Status status; CPS_Status status;
if (n_ntp_sources >= MAX_NTP_SOURCES)
return;
ntp_sources[n_ntp_sources].type = type; ntp_sources[n_ntp_sources].type = type;
status = CPS_ParseNTPSourceAdd(line, &ntp_sources[n_ntp_sources].params); status = CPS_ParseNTPSourceAdd(line, &ntp_sources[n_ntp_sources].params);