X-Git-Url: http://andersk.mit.edu/gitweb/openssh.git/blobdiff_plain/f8cc766444eae9f2c631b10358a29ff1971871e6..29ec8eb3b38c83e5389fe30f857d34fc86a8efa9:/hostfile.c diff --git a/hostfile.c b/hostfile.c index bf2a31c9..2cceb352 100644 --- a/hostfile.c +++ b/hostfile.c @@ -1,3 +1,4 @@ +/* $OpenBSD: hostfile.c,v 1.45 2006/08/03 03:34:42 deraadt Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -36,18 +37,25 @@ */ #include "includes.h" -RCSID("$OpenBSD: hostfile.c,v 1.34 2005/03/10 22:01:05 deraadt Exp $"); -#include +#include + +#include + #include #include -#include "packet.h" +#include +#include +#include +#include +#include + +#include "xmalloc.h" #include "match.h" #include "key.h" #include "hostfile.h" #include "log.h" -#include "xmalloc.h" static int extract_salt(const char *s, u_int l, char *salt, size_t salt_len) @@ -88,8 +96,8 @@ extract_salt(const char *s, u_int l, char *salt, size_t salt_len) return (-1); } if (ret != SHA_DIGEST_LENGTH) { - debug2("extract_salt: expected salt len %u, got %u", - salt_len, ret); + debug2("extract_salt: expected salt len %d, got %d", + SHA_DIGEST_LENGTH, ret); return (-1); } @@ -254,8 +262,10 @@ check_host_in_hostfile_by_key_or_type(const char *filename, if (key == NULL) { /* we found a key of the requested type */ - if (found->type == keytype) + if (found->type == keytype) { + fclose(f); return HOST_FOUND; + } continue; } @@ -315,7 +325,7 @@ add_host_to_hostfile(const char *filename, const char *host, const Key *key, { FILE *f; int success = 0; - char *hashed_host; + char *hashed_host = NULL; if (key == NULL) return 1; /* XXX ? */