summaryrefslogtreecommitdiff
path: root/progressmeter.c
diff options
context:
space:
mode:
authordjm <djm>2005-05-26 02:07:32 +0000
committerdjm <djm>2005-05-26 02:07:32 +0000
commit0bb8c987595b817da28832934228c987f3b480e3 (patch)
treeadfce79a56c3e3af82817f59d4ce7477f2094d05 /progressmeter.c
parent8900dbf2e386ad7d5dcbd99af58f4b60553a78ef (diff)
downloadopenssh-0bb8c987595b817da28832934228c987f3b480e3.tar.gz
- moritz@cvs.openbsd.org 2005/04/28 10:17:56
[progressmeter.c ssh-keyscan.c] add snprintf checks. ok djm@ markus@
Diffstat (limited to 'progressmeter.c')
-rw-r--r--progressmeter.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/progressmeter.c b/progressmeter.c
index 93f5a3e6..febe9aad 100644
--- a/progressmeter.c
+++ b/progressmeter.c
@@ -23,7 +23,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: progressmeter.c,v 1.22 2004/07/11 17:48:47 deraadt Exp $");
+RCSID("$OpenBSD: progressmeter.c,v 1.23 2005/04/28 10:17:56 moritz Exp $");
#include "progressmeter.h"
#include "atomicio.h"
@@ -147,6 +147,8 @@ refresh_progress_meter(void)
len = snprintf(buf, file_len + 1, "\r%s", file);
if (len < 0)
len = 0;
+ if (len >= file_len + 1)
+ len = file_len;
for (i = len; i < file_len; i++ )
buf[i] = ' ';
buf[file_len] = '\0';