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; len = nextdir - thisdir;
nextdir++; nextdir++;
} }
if (len > sizeof(cur)) if (len >= sizeof(cur))
continue; continue;
strncpy(cur, thisdir, len); strncpy(cur, thisdir, len);
cur[len] = '\0'; cur[len] = '\0';