From fd7c911f090749774cf1869420523c4811beeeb0 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Mon, 8 Nov 1999 16:15:55 +1100 Subject: Merged OpenBSD CVS changes that go away --- hostfile.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'hostfile.c') 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. */ #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); -- cgit v1.2.3