summaryrefslogtreecommitdiff
path: root/authfile.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2004-08-29 16:28:39 +1000
committerDarren Tucker <dtucker@zip.com.au>2004-08-29 16:28:39 +1000
commitf4b43712c135dc190e9e0ff145239c9e841cd55d (patch)
tree6705dba32007b6fa76c87e5320688eca64e9386a /authfile.c
parentf00e51d1f2ea01c33d5548b79a86c44036b90aae (diff)
downloadopenssh-git-f4b43712c135dc190e9e0ff145239c9e841cd55d.tar.gz
- djm@cvs.openbsd.org 2004/08/23 11:48:09
[authfile.c] fix error path, spotted by Martin.Kraemer AT Fujitsu-Siemens.com; ok markus
Diffstat (limited to 'authfile.c')
-rw-r--r--authfile.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/authfile.c b/authfile.c
index 76a60d02..1c006c43 100644
--- a/authfile.c
+++ b/authfile.c
@@ -36,7 +36,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: authfile.c,v 1.57 2004/06/21 17:36:31 avsm Exp $");
+RCSID("$OpenBSD: authfile.c,v 1.58 2004/08/23 11:48:09 djm Exp $");
#include <openssl/err.h>
#include <openssl/evp.h>
@@ -243,8 +243,10 @@ key_load_public_rsa1(int fd, const char *filename, char **commentp)
filename, strerror(errno));
return NULL;
}
- if (st.st_size > 1*1024*1024)
- close(fd);
+ if (st.st_size > 1*1024*1024) {
+ error("key file %.200s too large", filename);
+ return NULL;
+ }
len = (size_t)st.st_size; /* truncated */
buffer_init(&buffer);
@@ -335,6 +337,7 @@ key_load_private_rsa1(int fd, const char *filename, const char *passphrase,
return NULL;
}
if (st.st_size > 1*1024*1024) {
+ error("key file %.200s too large", filename);
close(fd);
return (NULL);
}