Subject: Re: [patch] fix X11 forwarding example reuse after free

Re: [patch] fix X11 forwarding example reuse after free

From: Daniel Stenberg <>
Date: Tue, 16 Aug 2011 10:36:06 +0200 (CEST)

On Tue, 16 Aug 2011, Henrik Nordström wrote:

> Avoid reuse after free when closing X11 channels


> And perhaps this keepalive fix as well, but is is not yet complete

I'm a bit curious about that fix. The comment here:

+ /* Skip sending keep-alive if already blocking trying to send something
+ rc = libssh2_keepalive_send (session, &seconds_to_next);

Isn't the comment saying the exact opposite of what the code does?
LIBSSH2_SESSION_BLOCK_OUTBOUND is set as direction if that was the one that
was "blocked" and couldn't be fulfilled. Alas, when sending of data couldn't
be completed this code will try to send the keepalive packet.

Or am I wrong?

> Add FIXME markers where _libssh2_transport_send is used badly

This patch seems to rely on the previous keepalive change so I didn't merge it

I did however also merge your document fixes as you will see!

Thanks a lot!


Received on 2011-08-16