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 away
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 ca0fe88a2..0e65bfe5f 100644
--- a/hostfile.c
+++ b/hostfile.c
@@ -14,7 +14,7 @@ Functions for manipulating the known hosts files.
14*/ 14*/
15 15
16#include "includes.h" 16#include "includes.h"
17RCSID("$Id: hostfile.c,v 1.1 1999/10/27 03:42:44 damien Exp $"); 17RCSID("$Id: hostfile.c,v 1.2 1999/11/08 05:15:55 damien Exp $");
18 18
19#include "packet.h" 19#include "packet.h"
20#include "ssh.h" 20#include "ssh.h"
@@ -265,11 +265,19 @@ add_host_to_hostfile(const char *filename, const char *host,
265 /* Print the host name and key to the file. */ 265 /* Print the host name and key to the file. */
266 fprintf(f, "%s %u ", host, bits); 266 fprintf(f, "%s %u ", host, bits);
267 buf = BN_bn2dec(e); 267 buf = BN_bn2dec(e);
268 assert(buf != NULL); 268 if (buf == NULL) {
269 error("add_host_to_hostfile: BN_bn2dec #1 failed");
270 fclose(f);
271 return 0;
272 }
269 fprintf(f, "%s ", buf); 273 fprintf(f, "%s ", buf);
270 free (buf); 274 free (buf);
271 buf = BN_bn2dec(n); 275 buf = BN_bn2dec(n);
272 assert(buf != NULL); 276 if (buf == NULL) {
277 error("add_host_to_hostfile: BN_bn2dec #2 failed");
278 fclose(f);
279 return 0;
280 }
273 fprintf(f, "%s\n", buf); 281 fprintf(f, "%s\n", buf);
274 free (buf); 282 free (buf);
275 283