libX11: Changes to 'master'

Alan Coopersmith alanc at kemper.freedesktop.org
Wed Feb 9 22:20:58 PST 2011


 src/xcms/LRGB.c    |    1 -
 src/xcms/cmsProp.c |   17 ++++++++++-------
 2 files changed, 10 insertions(+), 8 deletions(-)

New commits:
commit 502d414118c97d35a44f8e295709682022876331
Author: Erkki Seppälä <erkki.seppala at vincit.fi>
Date:   Thu Feb 3 17:08:57 2011 +0200

    xcms/cmsProp: don't deal with uninitialized values, fail instead
    
    Properly handle the return value of XGetWindowProperty by considering
    if after the loop as well.
    
    Using freed pointer "prop_ret"
    
    There were numerous things wrong in how this function interacted with
    XGetWindowProperty.
    
    None of the local variables were initialized and remained that way if
    the call to XGetWindowProperty returned 1 (not Succeed). That doesn't
    result in after_ret being initialized in which case if it happens to
    be 0, the loop was exited. In that case format_ret and nitems_ret were
    uninitialized and the function might return with success (but with
    uninitialized pointer in prop_ret) or XcmsFailure.
    
    As the buffer enlarging code was called only when XGetWindowProperty
    failed (returned not Success), after_ret would not have been
    initialized. It would have been initialized only if the
    XGetWindowProperty has returned Success earlier, but in that case the
    code fragment would not have been reached.
    
    This patch alters the function to return XcmsFailure if the call to
    XGetWindowProperty fails.
    
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira at nokia.com>
    Reviewed-by: Rami Ylimäki <rami.ylimaki at vincit.fi>
    Signed-off-by: Erkki Seppälä <erkki.seppala at vincit.fi>

commit c37e278993b9e5b3d7025ef4c434373a011996ec
Author: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira at nokia.com>
Date:   Mon Jan 31 14:02:07 2011 +0200

    xcms/LRGB: don't double-free property_return
    
    property_return was free'd before and in the case the conditional is true,
    the call to XcmsGetProperty failed which means that property_return wasn't
    set so there is no need to free it again.
    
    Double free of pointer "property_return" in call to "free"
    
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Erkki Seppälä <erkki.seppala at vincit.fi>
    Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira at nokia.com>



More information about the xorg-commit mailing list