mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
Missing error message when loading a private key file.
If the file is empty, or otherwise fails to start with a recognised 'PuTTY-User-Key-File' header line, we forgot to fill in the error message before returning failure, leading to a null pointer dereference.
This commit is contained in:
parent
78d0022c70
commit
3f0f6d2013
@ -612,8 +612,10 @@ struct ssh2_userkey *ssh2_load_userkey(const Filename *filename,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Read the first header line which contains the key type. */
|
/* Read the first header line which contains the key type. */
|
||||||
if (!read_header(fp, header))
|
if (!read_header(fp, header)) {
|
||||||
|
error = "no header line found in key file";
|
||||||
goto error;
|
goto error;
|
||||||
|
}
|
||||||
if (0 == strcmp(header, "PuTTY-User-Key-File-2")) {
|
if (0 == strcmp(header, "PuTTY-User-Key-File-2")) {
|
||||||
old_fmt = 0;
|
old_fmt = 0;
|
||||||
} else if (0 == strcmp(header, "PuTTY-User-Key-File-1")) {
|
} else if (0 == strcmp(header, "PuTTY-User-Key-File-1")) {
|
||||||
|
Loading…
Reference in New Issue
Block a user