From e5dbd6f20cbe44ce6009071359976193d78dcd8a Mon Sep 17 00:00:00 2001 From: Michael Buckley Date: Thu, 12 Sep 2019 14:51:45 -0700 Subject: [PATCH] knownhost.c: Double the static buffer size when reading and writing known hosts (#409) Notes: We had a user who was being repeatedly prompted to accept a server key repeatedly. It turns out the base64-encoded key was larger than the static buffers allocated to read and write known hosts. I doubled the size of these buffers. Credit: Michael Buckley --- src/knownhost.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/knownhost.c b/src/knownhost.c index b9dc47a..77798fb 100644 --- a/src/knownhost.c +++ b/src/knownhost.c @@ -955,7 +955,7 @@ libssh2_knownhost_readfile(LIBSSH2_KNOWNHOSTS *hosts, { FILE *file; int num = 0; - char buf[2048]; + char buf[4092]; if(type != LIBSSH2_KNOWNHOST_FILE_OPENSSH) return _libssh2_error(hosts->session, @@ -1194,7 +1194,7 @@ libssh2_knownhost_writefile(LIBSSH2_KNOWNHOSTS *hosts, struct known_host *node; FILE *file; int rc = LIBSSH2_ERROR_NONE; - char buffer[2048]; + char buffer[4092]; /* we only support this single file type for now, bail out on all other attempts */