summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@cvs.openbsd.org>2006-03-30 11:05:18 +0000
committerDarren Tucker <dtucker@cvs.openbsd.org>2006-03-30 11:05:18 +0000
commitfc105f638254e9e0753a4fb68fe35d991384dde0 (patch)
treee858be367e303a68e72c669b519e5f71cf6fffdd
parenta22a73e0b27953cdbb5c3263a89a290b04e0f055 (diff)
Correctly handle truncated files while converting keys; ok djm@
-rw-r--r--usr.bin/ssh/ssh-keygen.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/ssh/ssh-keygen.c b/usr.bin/ssh/ssh-keygen.c
index de78ef145ac..50bfb07d47a 100644
--- a/usr.bin/ssh/ssh-keygen.c
+++ b/usr.bin/ssh/ssh-keygen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-keygen.c,v 1.142 2006/03/25 18:40:14 deraadt Exp $ */
+/* $OpenBSD: ssh-keygen.c,v 1.143 2006/03/30 11:05:17 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -331,6 +331,8 @@ get_line(FILE *fp, char *line, size_t len)
line[pos++] = c;
line[pos] = '\0';
}
+ if (c == EOF)
+ return -1;
return pos;
}