summaryrefslogtreecommitdiff
path: root/hostfile.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>1999-11-08 16:15:55 +1100
committerDamien Miller <djm@mindrot.org>1999-11-08 16:15:55 +1100
commitfd7c911f090749774cf1869420523c4811beeeb0 (patch)
treecd57567ddb3371c0c805a8bd8ace0c66df02fa53 /hostfile.c
parent5ac5f1ca6b5270e1a755d75120f8217f5850c9b2 (diff)
Merged OpenBSD CVS changes that go awayV_1_2_PRE8
Diffstat (limited to 'hostfile.c')
-rw-r--r--hostfile.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/hostfile.c b/hostfile.c
index ca0fe88a..0e65bfe5 100644
--- a/hostfile.c
+++ b/hostfile.c
@@ -14,7 +14,7 @@ Functions for manipulating the known hosts files.
*/
#include "includes.h"
-RCSID("$Id: hostfile.c,v 1.1 1999/10/27 03:42:44 damien Exp $");
+RCSID("$Id: hostfile.c,v 1.2 1999/11/08 05:15:55 damien Exp $");
#include "packet.h"
#include "ssh.h"
@@ -265,11 +265,19 @@ add_host_to_hostfile(const char *filename, const char *host,
/* Print the host name and key to the file. */
fprintf(f, "%s %u ", host, bits);
buf = BN_bn2dec(e);
- assert(buf != NULL);
+ if (buf == NULL) {
+ error("add_host_to_hostfile: BN_bn2dec #1 failed");
+ fclose(f);
+ return 0;
+ }
fprintf(f, "%s ", buf);
free (buf);
buf = BN_bn2dec(n);
- assert(buf != NULL);
+ if (buf == NULL) {
+ error("add_host_to_hostfile: BN_bn2dec #2 failed");
+ fclose(f);
+ return 0;
+ }
fprintf(f, "%s\n", buf);
free (buf);