summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-libs/libssh/files/libssh-0.6.0_rc3-x2goclient_crash_fix-1.patch')
-rw-r--r--net-libs/libssh/files/libssh-0.6.0_rc3-x2goclient_crash_fix-1.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/net-libs/libssh/files/libssh-0.6.0_rc3-x2goclient_crash_fix-1.patch b/net-libs/libssh/files/libssh-0.6.0_rc3-x2goclient_crash_fix-1.patch
new file mode 100644
index 000000000000..8b4c7aeab589
--- /dev/null
+++ b/net-libs/libssh/files/libssh-0.6.0_rc3-x2goclient_crash_fix-1.patch
@@ -0,0 +1,37 @@
+From 8f162e3b13aa85aaa1257b775e1dc5d103f45570 Mon Sep 17 00:00:00 2001
+From: Andreas Schneider <asn@cryptomilk.org>
+Date: Sun, 22 Dec 2013 21:08:45 +0000
+Subject: poll: Correctly free ssh_event_fd_wrapper.
+
+This is allocated by ssh_event_add_fd.
+---
+(limited to 'src/poll.c')
+
+diff --git a/src/poll.c b/src/poll.c
+index 2fce52a..4d92e3f 100644
+--- a/src/poll.c
++++ b/src/poll.c
+@@ -852,12 +852,18 @@ int ssh_event_remove_fd(ssh_event event, socket_t fd) {
+ for (i = 0; i < used; i++) {
+ if(fd == event->ctx->pollfds[i].fd) {
+ ssh_poll_handle p = event->ctx->pollptrs[i];
+- struct ssh_event_fd_wrapper *pw = p->cb_data;
++ if (p->cb == ssh_event_fd_wrapper_callback) {
++ struct ssh_event_fd_wrapper *pw = p->cb_data;
++ SAFE_FREE(pw);
++ }
+
+- ssh_poll_ctx_remove(event->ctx, p);
+- free(pw);
++ /*
++ * The free function calls ssh_poll_ctx_remove() and decrements
++ * event->ctx->polls_used.
++ */
+ ssh_poll_free(p);
+ rc = SSH_OK;
++
+ /* restart the loop */
+ used = event->ctx->polls_used;
+ i = 0;
+--
+cgit v0.9.1