From a4c3f0d0a355a203841a07912363b8ee0e7d108f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 14 Jun 2009 14:29:15 +0200 Subject: [PATCH] fixed the length check in knownhost_writeline() since <= is actually good enough when the size includes the trailing zero --- src/knownhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/knownhost.c b/src/knownhost.c index 77d98cb..f9a5e39 100644 --- a/src/knownhost.c +++ b/src/knownhost.c @@ -721,7 +721,7 @@ knownhost_writeline(LIBSSH2_KNOWNHOSTS *hosts, else { nlen = strlen(node->name) + strlen(keytype) + strlen(node->key) + 3; /* ' ' + '\n' + \0 = 3 */ - if(nlen < buflen) + if(nlen <= buflen) /* these types have the plain name */ sprintf(buf, "%s%s %s\n", node->name, keytype, node->key); else