diff options
Diffstat (limited to 'hostfile.c')
-rw-r--r-- | hostfile.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -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); |