diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | progressmeter.c | 4 | ||||
-rw-r--r-- | ssh-keyscan.c | 7 |
3 files changed, 13 insertions, 3 deletions
@@ -41,6 +41,9 @@ | |||
41 | - jakob@cvs.openbsd.org 2005/04/26 13:08:37 | 41 | - jakob@cvs.openbsd.org 2005/04/26 13:08:37 |
42 | [ssh.c ssh_config.5] | 42 | [ssh.c ssh_config.5] |
43 | fallback gracefully if client cannot connect to ControlPath. ok djm@ | 43 | fallback gracefully if client cannot connect to ControlPath. ok djm@ |
44 | - moritz@cvs.openbsd.org 2005/04/28 10:17:56 | ||
45 | [progressmeter.c ssh-keyscan.c] | ||
46 | add snprintf checks. ok djm@ markus@ | ||
44 | 47 | ||
45 | 20050524 | 48 | 20050524 |
46 | - (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec] | 49 | - (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec] |
@@ -2540,4 +2543,4 @@ | |||
2540 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM | 2543 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM |
2541 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu | 2544 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu |
2542 | 2545 | ||
2543 | $Id: ChangeLog,v 1.3772 2005/05/26 02:07:13 djm Exp $ | 2546 | $Id: ChangeLog,v 1.3773 2005/05/26 02:07:32 djm Exp $ |
diff --git a/progressmeter.c b/progressmeter.c index 93f5a3e62..febe9aad5 100644 --- a/progressmeter.c +++ b/progressmeter.c | |||
@@ -23,7 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "includes.h" | 25 | #include "includes.h" |
26 | RCSID("$OpenBSD: progressmeter.c,v 1.22 2004/07/11 17:48:47 deraadt Exp $"); | 26 | RCSID("$OpenBSD: progressmeter.c,v 1.23 2005/04/28 10:17:56 moritz Exp $"); |
27 | 27 | ||
28 | #include "progressmeter.h" | 28 | #include "progressmeter.h" |
29 | #include "atomicio.h" | 29 | #include "atomicio.h" |
@@ -147,6 +147,8 @@ refresh_progress_meter(void) | |||
147 | len = snprintf(buf, file_len + 1, "\r%s", file); | 147 | len = snprintf(buf, file_len + 1, "\r%s", file); |
148 | if (len < 0) | 148 | if (len < 0) |
149 | len = 0; | 149 | len = 0; |
150 | if (len >= file_len + 1) | ||
151 | len = file_len; | ||
150 | for (i = len; i < file_len; i++ ) | 152 | for (i = len; i < file_len; i++ ) |
151 | buf[i] = ' '; | 153 | buf[i] = ' '; |
152 | buf[file_len] = '\0'; | 154 | buf[file_len] = '\0'; |
diff --git a/ssh-keyscan.c b/ssh-keyscan.c index bc2c3b728..fdcfc5b3c 100644 --- a/ssh-keyscan.c +++ b/ssh-keyscan.c | |||
@@ -7,7 +7,7 @@ | |||
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include "includes.h" | 9 | #include "includes.h" |
10 | RCSID("$OpenBSD: ssh-keyscan.c,v 1.52 2005/03/01 15:47:14 jmc Exp $"); | 10 | RCSID("$OpenBSD: ssh-keyscan.c,v 1.53 2005/04/28 10:17:56 moritz Exp $"); |
11 | 11 | ||
12 | #include "openbsd-compat/sys-queue.h" | 12 | #include "openbsd-compat/sys-queue.h" |
13 | 13 | ||
@@ -543,6 +543,11 @@ congreet(int s) | |||
543 | n = snprintf(buf, sizeof buf, "SSH-%d.%d-OpenSSH-keyscan\r\n", | 543 | n = snprintf(buf, sizeof buf, "SSH-%d.%d-OpenSSH-keyscan\r\n", |
544 | c->c_keytype == KT_RSA1? PROTOCOL_MAJOR_1 : PROTOCOL_MAJOR_2, | 544 | c->c_keytype == KT_RSA1? PROTOCOL_MAJOR_1 : PROTOCOL_MAJOR_2, |
545 | c->c_keytype == KT_RSA1? PROTOCOL_MINOR_1 : PROTOCOL_MINOR_2); | 545 | c->c_keytype == KT_RSA1? PROTOCOL_MINOR_1 : PROTOCOL_MINOR_2); |
546 | if (n == -1 || n >= sizeof buf) { | ||
547 | error("snprintf: buffer too small"); | ||
548 | confree(s); | ||
549 | return; | ||
550 | } | ||
546 | if (atomicio(vwrite, s, buf, n) != n) { | 551 | if (atomicio(vwrite, s, buf, n) != n) { |
547 | error("write (%s): %s", c->c_name, strerror(errno)); | 552 | error("write (%s): %s", c->c_name, strerror(errno)); |
548 | confree(s); | 553 | confree(s); |