Skip to content
Snippets Groups Projects
Commit 0d9c3fe7 authored by Francois Perrad's avatar Francois Perrad
Browse files

initialize variable and protect against NULL dereferencement

parent 2e38ac75
No related merge requests found
...@@ -234,7 +234,7 @@ static int newtcpforwarded(struct Channel * channel) { ...@@ -234,7 +234,7 @@ static int newtcpforwarded(struct Channel * channel) {
char *origaddr = NULL; char *origaddr = NULL;
unsigned int origport; unsigned int origport;
m_list_elem * iter = NULL; m_list_elem * iter = NULL;
struct TCPFwdEntry *fwd; struct TCPFwdEntry *fwd = NULL;
char portstring[NI_MAXSERV]; char portstring[NI_MAXSERV];
int err = SSH_OPEN_ADMINISTRATIVELY_PROHIBITED; int err = SSH_OPEN_ADMINISTRATIVELY_PROHIBITED;
...@@ -265,7 +265,7 @@ static int newtcpforwarded(struct Channel * channel) { ...@@ -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 */ /* We didn't request forwarding on that port */
cleantext(origaddr); cleantext(origaddr);
dropbear_log(LOG_INFO, "Server sent unrequested forward from \"%s:%d\"", dropbear_log(LOG_INFO, "Server sent unrequested forward from \"%s:%d\"",
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment