diff --git a/hw/xfree86/parser/Configint.h b/hw/xfree86/parser/Configint.h index 001b3a5ed0..d42a4fd0e7 100644 --- a/hw/xfree86/parser/Configint.h +++ b/hw/xfree86/parser/Configint.h @@ -203,6 +203,8 @@ else\ "The number \"%d\" given in this section must be in octal (0xxx) format." #define GPU_DEVICE_TOO_MANY \ "More than %d GPU devices defined." +#define CLOCKS_TOO_MANY \ +"More than %d Clocks defined." /* Warning messages */ #define OBSOLETE_MSG \ diff --git a/hw/xfree86/parser/Device.c b/hw/xfree86/parser/Device.c index 383f4727e8..3e1ed3bf7b 100644 --- a/hw/xfree86/parser/Device.c +++ b/hw/xfree86/parser/Device.c @@ -206,6 +206,8 @@ xf86parseDeviceSection(void) ptr->dev_clock[i] = (int) (xf86_lex_val.realnum * 1000.0 + 0.5); token = xf86getSubToken(&(ptr->dev_comment)); } + if (token == NUMBER && i >= CONF_MAXCLOCKS) + Error(CLOCKS_TOO_MANY, CONF_MAXCLOCKS); ptr->dev_clocks = i; xf86unGetToken(token); break;