xkbcomp: Changes to 'master'

Alan Coopersmith alanc at kemper.freedesktop.org
Thu Jun 4 07:18:08 PDT 2009


 misc.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit eeaa4aec798ef045d0b3b9de3c25932b85b9ac3d
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date:   Mon May 11 09:39:03 2009 -0700

    Use temporary buffer for generating Uxxx names to avoid overflow
    
    Instead of sprintf()'ing a 4 character string to a char [4] buffer,
    and leaving the trailing '\0' to overwrite into the next entry,
    snprintf() to a 5 character temp buffer and memcpy the 4 characters
    to the right place.
    
    Fixes parfait errors:
    Error: Buffer overflow at xkbcomp-1.0.4/misc.c:393
            in function 'ComputeKbdDefaults' [Standard C Library pattern matching]
           In sprintf related dereference of xkb->names->keys[i].name
            with index not less than '4'
           Destination array size is 4 bytes, data to be written is 4 bytes
    Error: Buffer overflow at xkbcomp-1.0.4/misc.c:402
            in function 'ComputeKbdDefaults' [Standard C Library pattern matching]
           In sprintf related dereference of xkb->names->keys[i].name
            with index not less than '4'
           Destination array size is 4 bytes, data to be written is 4 bytes
    
    [This bug was found by the Parfait bug checking tool.
      For more information see http://research.sun.com/projects/parfait ]
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at sun.com>



More information about the xorg-commit mailing list