Coverity #488: Avoid smashing an array on malformed config files.
This commit is contained in:
parent
20c1ef2cc3
commit
75a9afdbf4
|
@ -1,3 +1,9 @@
|
|||
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:
|
||||
|
|
Loading…
Reference in New Issue
Block a user