Commit 75a9afdb authored by Adam Jackson's avatar Adam Jackson 🎧

Coverity #488: Avoid smashing an array on malformed config files.

parent 20c1ef2c
2006-04-06 Adam Jackson <ajax@freedesktop.org>
* hw/xfree86/parser/Monitor.c:
Coverity #488: Avoid smashing an array on malformed config
files.
2006-04-06 Adam Jackson <ajax@freedesktop.org>
* hw/dmx/glxProxy/glxsingle.c:
......
......@@ -460,6 +460,8 @@ xf86parseMonitorSection (void)
if (xf86getSubToken (&(ptr->mon_comment)) != NUMBER)
Error (HORIZSYNC_MSG, NULL);
do {
if (ptr->mon_n_hsync >= CONF_MAX_HSYNC)
Error ("Sorry. Too many horizontal sync intervals.", NULL);
ptr->mon_hsync[ptr->mon_n_hsync].lo = val.realnum;
switch (token = xf86getSubToken (&(ptr->mon_comment)))
{
......@@ -485,8 +487,6 @@ xf86parseMonitorSection (void)
ptr->mon_n_hsync++;
goto HorizDone;
}
if (ptr->mon_n_hsync >= CONF_MAX_HSYNC)
Error ("Sorry. Too many horizontal sync intervals.", NULL);
ptr->mon_n_hsync++;
} while ((token = xf86getSubToken (&(ptr->mon_comment))) == NUMBER);
HorizDone:
......
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