# HG changeset patch # User Matt Johnston # Date 1495642218 -28800 # Node ID de1d895b1caeaad0ac02c108d47883043f36b378 # Parent bc9e2e148f58e7b0bfa0f5c28b141f7263050816 don't exit encountering short lines diff -r bc9e2e148f58 -r de1d895b1cae svr-authpubkey.c --- a/svr-authpubkey.c Thu May 25 00:09:40 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;