summaryrefslogtreecommitdiff
path: root/svr-authpubkey.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2017-05-25 22:21:23 +0800
committerMatt Johnston <matt@ucc.asn.au>2017-05-25 22:21:23 +0800
commite4c5e4c862f8116669e252cd2d572e08a14de085 (patch)
treec915e84bd19c98b6a801d629b9a880399b0b7d24 /svr-authpubkey.c
parentad0e36237e6bd6c7a465ca26175a61c6ca50fe11 (diff)
downloaddropbear-e4c5e4c862f8116669e252cd2d572e08a14de085.tar.gz
limit input size
Diffstat (limited to 'svr-authpubkey.c')
-rw-r--r--svr-authpubkey.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/svr-authpubkey.c b/svr-authpubkey.c
index 04d1b13..fbee63f 100644
--- a/svr-authpubkey.c
+++ b/svr-authpubkey.c
@@ -195,9 +195,9 @@ static int checkpubkey_line(buffer* line, int line_num, char* filename,
unsigned int pos, len;
int ret = DROPBEAR_FAILURE;
- if (line->len < MIN_AUTHKEYS_LINE) {
- TRACE(("checkpubkey: line too short"))
- return DROPBEAR_FAILURE; /* line is too short for it to be a valid key */
+ if (line->len < MIN_AUTHKEYS_LINE || line->len > MAX_AUTHKEYS_LINE) {
+ TRACE(("checkpubkey: bad line length %d", line->len))
+ return DROPBEAR_FAILURE;
}
/* compare the algorithm. +3 so we have enough bytes to read a space and some base64 characters too. */