Probable off by one buffer overflow in .../xorgconfig/xorgconfig.c

X.Org Bug #11858 <http://bugs.freedesktop.org/show_bug.cgi?id=11858>
Patch #11005 <http://bugs.freedesktop.org/attachment.cgi?id=11005>
This commit is contained in:
Roland "Test-tools" Bär 2007-08-06 12:37:52 -07:00 committed by Alan Coopersmith
parent e717eb82dc
commit f6aa2200f2

View File

@ -2442,7 +2442,7 @@ write_fontpath_section(FILE *f)
len = nextdir - thisdir;
nextdir++;
}
if (len > sizeof(cur))
if (len >= sizeof(cur))
continue;
strncpy(cur, thisdir, len);
cur[len] = '\0';