Mercurial > dropbear
comparison cli-tcpfwd.c @ 1344:b90da477ab63 coverity
merge coverity
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 18 May 2017 23:02:39 +0800 |
parents | e47e4b8a005d |
children | f7a53832501d |
comparison
equal
deleted
inserted
replaced
1318:10e2a7727253 | 1344:b90da477ab63 |
---|---|
232 static int newtcpforwarded(struct Channel * channel) { | 232 static int newtcpforwarded(struct Channel * channel) { |
233 | 233 |
234 char *origaddr = NULL; | 234 char *origaddr = NULL; |
235 unsigned int origport; | 235 unsigned int origport; |
236 m_list_elem * iter = NULL; | 236 m_list_elem * iter = NULL; |
237 struct TCPFwdEntry *fwd; | 237 struct TCPFwdEntry *fwd = NULL; |
238 char portstring[NI_MAXSERV]; | 238 char portstring[NI_MAXSERV]; |
239 int err = SSH_OPEN_ADMINISTRATIVELY_PROHIBITED; | 239 int err = SSH_OPEN_ADMINISTRATIVELY_PROHIBITED; |
240 | 240 |
241 origaddr = buf_getstring(ses.payload, NULL); | 241 origaddr = buf_getstring(ses.payload, NULL); |
242 origport = buf_getint(ses.payload); | 242 origport = buf_getint(ses.payload); |
263 } | 263 } |
264 } | 264 } |
265 } | 265 } |
266 | 266 |
267 | 267 |
268 if (iter == NULL) { | 268 if (iter == NULL || fwd == NULL) { |
269 /* We didn't request forwarding on that port */ | 269 /* We didn't request forwarding on that port */ |
270 cleantext(origaddr); | 270 cleantext(origaddr); |
271 dropbear_log(LOG_INFO, "Server sent unrequested forward from \"%s:%d\"", | 271 dropbear_log(LOG_INFO, "Server sent unrequested forward from \"%s:%d\"", |
272 origaddr, origport); | 272 origaddr, origport); |
273 goto out; | 273 goto out; |