summaryrefslogtreecommitdiff
path: root/usr.sbin/ftp-proxy
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2005-11-17 13:32:06 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2005-11-17 13:32:06 +0000
commit64c525ca92538bc07bd354d521b3aaddf2ea461e (patch)
treebbbdaaa6db3d6bfad9aadedaa3e01355edfd7a9f /usr.sbin/ftp-proxy
parent1815fd66be7847284fd93750bef227b33c09491a (diff)
buffer overflow
Diffstat (limited to 'usr.sbin/ftp-proxy')
-rw-r--r--usr.sbin/ftp-proxy/ftp-proxy.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/ftp-proxy/ftp-proxy.c b/usr.sbin/ftp-proxy/ftp-proxy.c
index 8e3d6cbed4d..faf0b77c16b 100644
--- a/usr.sbin/ftp-proxy/ftp-proxy.c
+++ b/usr.sbin/ftp-proxy/ftp-proxy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftp-proxy.c,v 1.5 2005/06/07 14:12:07 camield Exp $ */
+/* $OpenBSD: ftp-proxy.c,v 1.6 2005/11/17 13:32:05 deraadt Exp $ */
/*
* Copyright (c) 2004, 2005 Camiel Dobbelaar, <cd@sentia.nl>
@@ -174,11 +174,12 @@ client_parse_anon(struct session *s)
{
if (strcasecmp("USER ftp\r\n", linebuf) != 0 &&
strcasecmp("USER anonymous\r\n", linebuf) != 0) {
- linelen = snprintf(linebuf, sizeof linebuf,
+ snprintf(linebuf, sizeof linebuf,
"500 Only anonymous FTP allowed\r\n");
logmsg(LOG_DEBUG, "#%d proxy: %s", s->id, linebuf);
/* Talk back to the client ourself. */
+ linelen = strlen(linebuf);
bufferevent_write(s->client_bufev, linebuf, linelen);
/* Clear buffer so it's not sent to the server. */