• Erkki Seppälä's avatar
    record: avoid crash when calling RecordFlushReplyBuffer recursively · c8a4e1e7
    Erkki Seppälä authored
    Backported from X.Org:
    
    commit 0801afbd7c2c644c672b37f8463f1a0cbadebd2e
    Author: Erkki Seppälä <erkki.seppala@vincit.fi>
    Date:   Thu Feb 10 15:35:14 2011 +0200
    
        record: avoid crash when calling RecordFlushReplyBuffer recursively
    
        RecordFlushReplyBuffer can call itself recursively through
        WriteClient->CallCallbacks->_CallCallbacks->RecordFlushAllContexts
        when the recording client's buffer cannot be completely emptied in one
        WriteClient. When a such a recursion occurs, it will not be broken out
        of which results in segmentation fault when the stack is exhausted.
    
        This patch adds a counter (a flag, really) that guards against this
        situation, to break out of the recursion.
    
        One alternative to this change would be to change _CallCallbacks to
        check the corresponding counter before the callback loop, but that
        might affect existing behavior, which may be relied upon.
    Reviewed-by: 's avatarRami Ylimäki <rami.ylimaki@vincit.fi>
    Signed-off-by: 's avatarErkki Seppälä <erkki.seppala@vincit.fi>
    Signed-off-by: 's avatarKeith Packard <keithp@keithp.com>
    Backported-to-NX-by: 's avatarMihai Moldovan <ionic@ionic.de>
    
    Fixes: ArcticaProject/nx-libs#417.
    c8a4e1e7
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...
nxcompshad Loading commit data...
nxproxy Loading commit data...
testscripts Loading commit data...
.gitignore 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...
mesa-quilt Loading commit data...
nx-libs.spec Loading commit data...
regenerate-symbol-docs.sh Loading commit data...
replace.sh Loading commit data...
roll-tarballs.sh Loading commit data...
version.sh Loading commit data...