Mercurial > dropbear
comparison cli-tcpfwd.c @ 1256:506f7681d0f8 coverity
merge up to date
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Tue, 15 Mar 2016 22:45:43 +0800 |
parents | 52a456a3add0 |
children | d49bda490798 |
comparison
equal
deleted
inserted
replaced
1219:84cf9062718d | 1256:506f7681d0f8 |
---|---|
229 TRACE(("leave setup_remotetcp")) | 229 TRACE(("leave setup_remotetcp")) |
230 } | 230 } |
231 | 231 |
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; |
238 char portstring[NI_MAXSERV]; | 238 char portstring[NI_MAXSERV]; |
239 int err = SSH_OPEN_ADMINISTRATIVELY_PROHIBITED; | 239 int err = SSH_OPEN_ADMINISTRATIVELY_PROHIBITED; |
265 } | 265 } |
266 | 266 |
267 | 267 |
268 if (iter == NULL) { | 268 if (iter == 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; |
274 } | 274 } |
275 | 275 |
276 snprintf(portstring, sizeof(portstring), "%d", fwd->connectport); | 276 snprintf(portstring, sizeof(portstring), "%u", fwd->connectport); |
277 channel->conn_pending = connect_remote(fwd->connectaddr, portstring, channel_connect_done, channel); | 277 channel->conn_pending = connect_remote(fwd->connectaddr, portstring, channel_connect_done, channel); |
278 | 278 |
279 channel->prio = DROPBEAR_CHANNEL_PRIO_UNKNOWABLE; | 279 channel->prio = DROPBEAR_CHANNEL_PRIO_UNKNOWABLE; |
280 | 280 |
281 err = SSH_OPEN_IN_PROGRESS; | 281 err = SSH_OPEN_IN_PROGRESS; |