[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [patch] SIGSEGV when adding Connector to Event


On 29.01.19 09:49, Andreas Schneider wrote:

> On Monday, 28 January 2019 23:10:09 CET g4-lisz@xxxxxxxxxxxx wrote:
>> Hi all
>>
>> There's a bug in the connector API when subsequently adding to and
>> removing connectors from an event loop.
>>
>> Here's some dummy code to reproduce it (I will add real code later):
> Hi Till,
>
> thank you very much for your contribution. The e-mail the patch has been 
> created with looks like a company address. Could you please send the 
> Certificate of Origin from that address?

Hi Andreas,

oh I see... This was not on purpose. My contributions can be considered
as private work. I attached a new patch.

Regards,
Till

From 80d13178376fef3fa897b390cc1aad6830090712 Mon Sep 17 00:00:00 2001
From: Till Wimmer <g4-lisz@xxxxxxxxxxxx>
Date: Tue, 29 Jan 2019 12:01:31 +0100
Subject: [PATCH] Don't NULL connector->channels on event remove

Signed-off-by: Till Wimmer <g4-lisz@xxxxxxxxxxxx>
---
 src/connector.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/connector.c b/src/connector.c
index c4f6af5..0062785 100644
--- a/src/connector.c
+++ b/src/connector.c
@@ -641,14 +641,12 @@ int ssh_connector_remove_event(ssh_connector connector) {
         session = ssh_channel_get_session(connector->in_channel);
 
         ssh_event_remove_session(connector->event, session);
-        connector->in_channel = NULL;
     }
 
     if (connector->out_channel != NULL) {
         session = ssh_channel_get_session(connector->out_channel);
 
         ssh_event_remove_session(connector->event, session);
-        connector->out_channel = NULL;
     }
     connector->event = NULL;
 
-- 
2.7.4


Follow-Ups:
Re: [patch] SIGSEGV when adding Connector to EventAndreas Schneider <asn@xxxxxxxxxxxxxx>
References:
[patch] SIGSEGV when adding Connector to Eventg4-lisz@xxxxxxxxxxxx
Archive administrator: postmaster@lists.cynapses.org