summaryrefslogtreecommitdiff
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
parentf00e51d1f2ea01c33d5548b79a86c44036b90aae (diff)
- 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
-rw-r--r--ChangeLog6
-rw-r--r--authfile.c9
2 files changed, 11 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 8302ee1d3..4f78da8b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,10 @@
2 - (dtucker) [openbsd-compat/getrrsetbyname.c] Prevent getrrsetbyname from 2 - (dtucker) [openbsd-compat/getrrsetbyname.c] Prevent getrrsetbyname from
3 failing with NOMEMORY if no sigs are returned and malloc(0) returns NULL. 3 failing with NOMEMORY if no sigs are returned and malloc(0) returns NULL.
4 From Martin.Kraemer at Fujitsu-Siemens.com; ok djm@ 4 From Martin.Kraemer at Fujitsu-Siemens.com; ok djm@
5 - (dtucker) OpenBSD CVS Sync
6 - djm@cvs.openbsd.org 2004/08/23 11:48:09
7 [authfile.c]
8 fix error path, spotted by Martin.Kraemer AT Fujitsu-Siemens.com; ok markus
5 9
620040828 1020040828
7 - (dtucker) [openbsd-compat/mktemp.c] Remove superfluous Cygwin #ifdef; from 11 - (dtucker) [openbsd-compat/mktemp.c] Remove superfluous Cygwin #ifdef; from
@@ -1669,4 +1673,4 @@
1669 - (djm) Trim deprecated options from INSTALL. Mention UsePAM 1673 - (djm) Trim deprecated options from INSTALL. Mention UsePAM
1670 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu 1674 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
1671 1675
1672$Id: ChangeLog,v 1.3522 2004/08/29 06:12:29 dtucker Exp $ 1676$Id: ChangeLog,v 1.3523 2004/08/29 06:28:39 dtucker Exp $
diff --git a/authfile.c b/authfile.c
index 76a60d020..1c006c43d 100644
--- a/authfile.c
+++ b/authfile.c
@@ -36,7 +36,7 @@
36 */ 36 */
37 37
38#include "includes.h" 38#include "includes.h"
39RCSID("$OpenBSD: authfile.c,v 1.57 2004/06/21 17:36:31 avsm Exp $"); 39RCSID("$OpenBSD: authfile.c,v 1.58 2004/08/23 11:48:09 djm Exp $");
40 40
41#include <openssl/err.h> 41#include <openssl/err.h>
42#include <openssl/evp.h> 42#include <openssl/evp.h>
@@ -243,8 +243,10 @@ key_load_public_rsa1(int fd, const char *filename, char **commentp)
243 filename, strerror(errno)); 243 filename, strerror(errno));
244 return NULL; 244 return NULL;
245 } 245 }
246 if (st.st_size > 1*1024*1024) 246 if (st.st_size > 1*1024*1024) {
247 close(fd); 247 error("key file %.200s too large", filename);
248 return NULL;
249 }
248 len = (size_t)st.st_size; /* truncated */ 250 len = (size_t)st.st_size; /* truncated */
249 251
250 buffer_init(&buffer); 252 buffer_init(&buffer);
@@ -335,6 +337,7 @@ key_load_private_rsa1(int fd, const char *filename, const char *passphrase,
335 return NULL; 337 return NULL;
336 } 338 }
337 if (st.st_size > 1*1024*1024) { 339 if (st.st_size > 1*1024*1024) {
340 error("key file %.200s too large", filename);
338 close(fd); 341 close(fd);
339 return (NULL); 342 return (NULL);
340 } 343 }