From f208d7920ce1d37e00a216c6f7129c7d61b66922 Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Thu, 24 Mar 2016 12:36:56 +0100 Subject: [PATCH 1/3] remove duplicated include --- common-channel.c | 1 - 1 file changed, 1 deletion(-) diff --git a/common-channel.c b/common-channel.c index 835e493..7383f47 100644 --- a/common-channel.c +++ b/common-channel.c @@ -32,7 +32,6 @@ #include "circbuffer.h" #include "dbutil.h" #include "channel.h" -#include "ssh.h" #include "listener.h" #include "runopts.h" #include "netio.h" From 2e38ac7504db6452fa1b0096f35efd55e95d12df Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Fri, 1 Jan 2016 11:46:58 +0100 Subject: [PATCH 2/3] initialize variable --- svr-chansession.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svr-chansession.c b/svr-chansession.c index 6dbc8ad..22fc954 100644 --- a/svr-chansession.c +++ b/svr-chansession.c @@ -634,7 +634,7 @@ static void make_connection_string(struct ChanSess *chansess) { static int sessioncommand(struct Channel *channel, struct ChanSess *chansess, int iscmd, int issubsys) { - unsigned int cmdlen; + unsigned int cmdlen = 0; int ret; TRACE(("enter sessioncommand")) From 0d9c3fe70b828ff4af3a7b9fa20a169afa1a1fae Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Tue, 15 Nov 2016 15:36:05 +0100 Subject: [PATCH 3/3] initialize variable and protect against NULL dereferencement --- cli-tcpfwd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli-tcpfwd.c b/cli-tcpfwd.c index 95b2d7c..78f61f7 100644 --- a/cli-tcpfwd.c +++ b/cli-tcpfwd.c @@ -234,7 +234,7 @@ static int newtcpforwarded(struct Channel * channel) { char *origaddr = NULL; unsigned int origport; m_list_elem * iter = NULL; - struct TCPFwdEntry *fwd; + struct TCPFwdEntry *fwd = NULL; char portstring[NI_MAXSERV]; int err = SSH_OPEN_ADMINISTRATIVELY_PROHIBITED; @@ -265,7 +265,7 @@ static int newtcpforwarded(struct Channel * channel) { } - if (iter == NULL) { + if (iter == NULL || fwd == NULL) { /* We didn't request forwarding on that port */ cleantext(origaddr); dropbear_log(LOG_INFO, "Server sent unrequested forward from \"%s:%d\"",