From c31e3cd43764172f073fe6b5872f7e33616e7a7b Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Wed, 24 Oct 2018 19:14:13 +0100 Subject: [PATCH] Fix a couple of uninitialised variables. throttled_by_backlog is quite new, so it's not too surprising that I hadn't already noticed it wasn't initialised. But the failure to null out the final 'next' pointer in the callbacks list when it's rewritten as a result of delete_callbacks_for_context is a great deal older, so I'm a lot more puzzled about how it hasn't come up until now! --- callback.c | 1 + ssh2connection.c | 1 + 2 files changed, 2 insertions(+) diff --git a/callback.c b/callback.c index 0a05f624..09a5e49b 100644 --- a/callback.c +++ b/callback.c @@ -65,6 +65,7 @@ void delete_callbacks_for_context(void *ctx) cbhead = newhead; cbtail = newtail; + newtail->next = NULL; } void queue_toplevel_callback(toplevel_callback_fn_t fn, void *ctx) diff --git a/ssh2connection.c b/ssh2connection.c index fa079fec..b858a04c 100644 --- a/ssh2connection.c +++ b/ssh2connection.c @@ -1229,6 +1229,7 @@ void ssh2_channel_init(struct ssh2_channel *c) c->closes = 0; c->pending_eof = FALSE; c->throttling_conn = FALSE; + c->throttled_by_backlog = FALSE; c->sharectx = NULL; c->locwindow = c->locmaxwin = c->remlocwin = s->ssh_is_simple ? OUR_V2_BIGWIN : OUR_V2_WINSIZE;