1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Fix null deref on writing OpenSSH pubkey with no comment.

If we're called on to generate the one-line OpenSSH public key format
for a key that we don't have a comment field for, we were mistakenly
testing this by checking if '*comment' rather than 'comment' was zero,
i.e. if comment was NULL we'd dereference it by mistake.
This commit is contained in:
Simon Tatham 2018-05-25 14:06:51 +01:00
parent 23f3b65181
commit 2259f3d335

View File

@ -1502,7 +1502,7 @@ static char *ssh2_pubkey_openssh_str_internal(const char *comment,
i += n;
p += 4;
}
if (*comment) {
if (comment) {
*p++ = ' ';
strcpy(p, comment);
} else