summaryrefslogtreecommitdiffstats
path: root/clientloop.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2005-06-17 12:59:34 +1000
committerDamien Miller <djm@mindrot.org>2005-06-17 12:59:34 +1000
commiteccb9de72aa29da5a3fad87a4287b32438689c1f (patch)
tree9b8ef20a7e454b984e0ad67b54b2bdc5577aa2fa /clientloop.c
parent677257fe07dd2b9a58817e1d42fc2c25bb618a4d (diff)
- djm@cvs.openbsd.org 2005/06/17 02:44:33
[auth-rsa.c auth.c auth1.c auth2-chall.c auth2-gss.c authfd.c authfile.c] [bufaux.c canohost.c channels.c cipher.c clientloop.c dns.c gss-serv.c] [kex.c kex.h key.c mac.c match.c misc.c packet.c packet.h scp.c] [servconf.c session.c session.h sftp-client.c sftp-server.c sftp.c] [ssh-keyscan.c ssh-rsa.c sshconnect.c sshconnect1.c sshconnect2.c sshd.c] make this -Wsign-compare clean; ok avsm@ markus@ NB. auth1.c changes not committed yet (conflicts with uncommitted sync) NB2. more work may be needed to make portable Wsign-compare clean
Diffstat (limited to 'clientloop.c')
-rw-r--r--clientloop.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/clientloop.c b/clientloop.c
index ee36cc9e..a030cf6e 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -59,7 +59,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: clientloop.c,v 1.138 2005/06/16 03:38:36 djm Exp $");
+RCSID("$OpenBSD: clientloop.c,v 1.139 2005/06/17 02:44:32 djm Exp $");
#include "ssh.h"
#include "ssh1.h"
@@ -659,12 +659,12 @@ client_process_control(fd_set * readset)
{
Buffer m;
Channel *c;
- int client_fd, new_fd[3], ver, i, allowed;
+ int client_fd, new_fd[3], ver, allowed;
socklen_t addrlen;
struct sockaddr_storage addr;
struct confirm_ctx *cctx;
char *cmd;
- u_int len, env_len, command, flags;
+ u_int i, len, env_len, command, flags;
uid_t euid;
gid_t egid;
@@ -971,7 +971,10 @@ process_escapes(Buffer *bin, Buffer *bout, Buffer *berr, char *buf, int len)
u_char ch;
char *s;
- for (i = 0; i < len; i++) {
+ if (len <= 0)
+ return (0);
+
+ for (i = 0; i < (u_int)len; i++) {
/* Get one character at a time. */
ch = buf[i];