mirror of
https://github.com/clearml/dropbear
synced 2025-01-31 10:57:01 +00:00
don't exit encountering short lines
This commit is contained in:
parent
6e0b539e9c
commit
fb4e07f7a8
@ -200,6 +200,10 @@ static int checkpubkey_line(buffer* line, int line_num, char* filename,
|
|||||||
return DROPBEAR_FAILURE; /* line is too short for it to be a valid key */
|
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 */
|
/* check the key type */
|
||||||
if (strncmp((const char *) buf_getptr(line, algolen), algo, algolen) != 0) {
|
if (strncmp((const char *) buf_getptr(line, algolen), algo, algolen) != 0) {
|
||||||
int is_comment = 0;
|
int is_comment = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user