]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
Fix crash in config parsing with too many servers
authorMiroslav Lichvar <mlichvar@redhat.com>
Fri, 26 Apr 2013 12:17:21 +0000 (14:17 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Fri, 26 Apr 2013 12:17:21 +0000 (14:17 +0200)
conf.c

diff --git a/conf.c b/conf.c
index fbb009030800a5a51b87949bc55ef0f9a655284f..3b691f1a365309bd4844a8ba31abb5d8d3bd3eba 100644 (file)
--- a/conf.c
+++ b/conf.c
@@ -395,6 +395,9 @@ parse_source(const char *line, NTP_Source_Type type)
 {
   CPS_Status status;
 
+  if (n_ntp_sources >= MAX_NTP_SOURCES)
+    return;
+
   ntp_sources[n_ntp_sources].type = type;
   status = CPS_ParseNTPSourceAdd(line, &ntp_sources[n_ntp_sources].params);