summaryrefslogtreecommitdiff
path: root/sshconnect2.c
diff options
context:
space:
mode:
Diffstat (limited to 'sshconnect2.c')
-rw-r--r--sshconnect2.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sshconnect2.c b/sshconnect2.c
index baa4e7028..ac3ad013b 100644
--- a/sshconnect2.c
+++ b/sshconnect2.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: sshconnect2.c,v 1.70 2001/04/17 10:53:26 markus Exp $"); 26RCSID("$OpenBSD: sshconnect2.c,v 1.71 2001/04/18 22:03:45 markus Exp $");
27 27
28#include <openssl/bn.h> 28#include <openssl/bn.h>
29#include <openssl/md5.h> 29#include <openssl/md5.h>
@@ -816,14 +816,17 @@ userauth_hostbased(Authctxt *authctxt)
816 u_char *signature, *blob; 816 u_char *signature, *blob;
817 char *chost, *pkalg, *p; 817 char *chost, *pkalg, *p;
818 u_int blen, slen; 818 u_int blen, slen;
819 int ok, i, found = 0; 819 int ok, i, len, found = 0;
820 820
821 p = get_local_name(packet_get_connection_in()); 821 p = get_local_name(packet_get_connection_in());
822 if (p == NULL) { 822 if (p == NULL) {
823 error("userauth_hostbased: cannot get local ipaddr/name"); 823 error("userauth_hostbased: cannot get local ipaddr/name");
824 return 0; 824 return 0;
825 } 825 }
826 chost = xstrdup(p); 826 len = strlen(p) + 2;
827 chost = xmalloc(len);
828 strlcpy(chost, p, len);
829 strlcat(chost, ".", len);
827 debug2("userauth_hostbased: chost %s", chost); 830 debug2("userauth_hostbased: chost %s", chost);
828 /* check for a useful key */ 831 /* check for a useful key */
829 for (i = 0; i < authctxt->nkeys; i++) { 832 for (i = 0; i < authctxt->nkeys; i++) {