summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-02-10 21:34:46 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-02-10 21:34:46 +0000
commit075390a3f8ea4f56265d8776c762ab4dc10d8227 (patch)
tree70100d56d311d93835c0924763e97ae7a25920f4
parentd1f20ec3683183332f78ef82487a982b929c60cc (diff)
- markus@cvs.openbsd.org 2001/02/8 22:37:10
[canohost.c] remove last call to sprintf; ok deraadt@
-rw-r--r--ChangeLog5
-rw-r--r--canohost.c16
2 files changed, 12 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index e443f1c62..e33007ac5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,9 @@
6 - markus@cvs.openbsd.org 2001/02/10 12:52:02 6 - markus@cvs.openbsd.org 2001/02/10 12:52:02
7 [auth2.c] 7 [auth2.c]
8 offer passwd before s/key 8 offer passwd before s/key
9 - markus@cvs.openbsd.org 2001/02/8 22:37:10
10 [canohost.c]
11 remove last call to sprintf; ok deraadt@
9 12
1020010210 1320010210
11 - (djm) Sync sftp and scp stuff from OpenBSD: 14 - (djm) Sync sftp and scp stuff from OpenBSD:
@@ -3789,4 +3792,4 @@
3789 - Wrote replacements for strlcpy and mkdtemp 3792 - Wrote replacements for strlcpy and mkdtemp
3790 - Released 1.0pre1 3793 - Released 1.0pre1
3791 3794
3792$Id: ChangeLog,v 1.714 2001/02/10 21:31:53 mouring Exp $ 3795$Id: ChangeLog,v 1.715 2001/02/10 21:34:46 mouring Exp $
diff --git a/canohost.c b/canohost.c
index 8f4bebda2..d47940b1b 100644
--- a/canohost.c
+++ b/canohost.c
@@ -12,7 +12,7 @@
12 */ 12 */
13 13
14#include "includes.h" 14#include "includes.h"
15RCSID("$OpenBSD: canohost.c,v 1.21 2001/02/08 19:30:51 itojun Exp $"); 15RCSID("$OpenBSD: canohost.c,v 1.22 2001/02/08 22:37:10 markus Exp $");
16 16
17#include "packet.h" 17#include "packet.h"
18#include "xmalloc.h" 18#include "xmalloc.h"
@@ -142,10 +142,10 @@ get_remote_hostname(int socket, int reverse_mapping_check)
142void 142void
143check_ip_options(int socket, char *ipaddr) 143check_ip_options(int socket, char *ipaddr)
144{ 144{
145 u_char options[200], *ucp; 145 u_char options[200];
146 char text[1024], *cp; 146 char text[sizeof(options) * 3 + 1];
147 socklen_t option_size; 147 socklen_t option_size;
148 int ipproto; 148 int i, ipproto;
149 struct protoent *ip; 149 struct protoent *ip;
150 150
151 if ((ip = getprotobyname("ip")) != NULL) 151 if ((ip = getprotobyname("ip")) != NULL)
@@ -155,10 +155,10 @@ check_ip_options(int socket, char *ipaddr)
155 option_size = sizeof(options); 155 option_size = sizeof(options);
156 if (getsockopt(socket, ipproto, IP_OPTIONS, (void *)options, 156 if (getsockopt(socket, ipproto, IP_OPTIONS, (void *)options,
157 &option_size) >= 0 && option_size != 0) { 157 &option_size) >= 0 && option_size != 0) {
158 cp = text; 158 text[0] = '\0';
159 /* Note: "text" buffer must be at least 3x as big as options. */ 159 for (i = 0; i < option_size; i++)
160 for (ucp = options; option_size > 0; ucp++, option_size--, cp += 3) 160 snprintf(text + i*3, sizeof(text) - i*3,
161 sprintf(cp, " %2.2x", *ucp); 161 " %2.2x", options[i]);
162 log("Connection from %.100s with IP options:%.800s", 162 log("Connection from %.100s with IP options:%.800s",
163 ipaddr, text); 163 ipaddr, text);
164 packet_disconnect("Connection from %.100s with IP options:%.800s", 164 packet_disconnect("Connection from %.100s with IP options:%.800s",