• Alan Coopersmith's avatar
    Integer overflows in stringSectionSize() cause buffer overflow in… · 0349af11
    Alan Coopersmith authored
    Integer overflows in stringSectionSize() cause buffer overflow in ReadColornameDB() [CVE-2013-1981 6/13]
    
    LoadColornameDB() calls stringSectionSize() to do a first pass over the
    file (which may be provided by the user via XCMSDB environment variable)
    to determine how much memory needs to be allocated to read in the file,
    then allocates the returned sizes and calls ReadColornameDB() to load the
    data from the file into that newly allocated memory.
    
    If stringSectionSize() overflows the signed ints used to calculate the
    file size (say if you have an xcmsdb with ~4 billion lines in or a
    combined string length of ~4 gig - which while it may have been
    inconceivable when Xlib was written, is quite possible today), then
    LoadColornameDB() may allocate a memory buffer much smaller than the
    amount of data ReadColornameDB() will write to it.
    
    The total size is left limited to an int, because if your xcmsdb file
    is larger than 2gb, you're doing it wrong.
    Reported-by: 's avatarIlja Van Sprundel <ivansprundel@ioactive.com>
    Signed-off-by: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
    Reviewed-by: 's avatarMatthieu Herrb <matthieu.herrb@laas.fr>
    Signed-off-by: 's avatarJulien Cristau <jcristau@debian.org>
    Backported-to-NX-by: 's avatarUlrich Sibiller <uli42@gmx.de>
    0349af11
Name
Last commit
Last update
bin Loading commit data...
debian Loading commit data...
doc Loading commit data...
etc Loading commit data...
nx-X11 Loading commit data...
nxcomp Loading commit data...
nxcompext Loading commit data...
nxcompshad Loading commit data...
nxproxy Loading commit data...
testscripts Loading commit data...
COPYING Loading commit data...
ChangeLog Loading commit data...
LICENSE Loading commit data...
LICENSE.nxcomp Loading commit data...
Makefile Loading commit data...
README.NX-development Loading commit data...
README.md Loading commit data...
VERSION Loading commit data...
fix-patch-whitespace Loading commit data...
make-changelog.sh Loading commit data...
nx-libs.spec Loading commit data...
replace.sh Loading commit data...
roll-tarballs.sh Loading commit data...
version.sh Loading commit data...