# HG changeset patch # User Matt Johnston # Date 1495642218 -28800 # Node ID 814f22d4a58fd5f3418aae2fad4c46c8c6039c07 # Parent 950c6973f27bc42a65643ee9ec7c930f718bb0c3 don't exit encountering short lines diff -r 950c6973f27b -r 814f22d4a58f svr-authpubkey.c --- a/svr-authpubkey.c Tue May 23 22:29:21 2017 +0800 +++ b/svr-authpubkey.c Thu May 25 00:10:18 2017 +0800 @@ -200,6 +200,10 @@ return DROPBEAR_FAILURE; /* line is too short for it to be a valid key */ } + /* compare the algorithm. +3 so we have enough bytes to read a space and some base64 characters too. */ + if (line->pos + algolen+3 > line->len) { + goto out; + } /* check the key type */ if (strncmp((const char *) buf_getptr(line, algolen), algo, algolen) != 0) { int is_comment = 0;