X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/04627c33eaedaab98bce22ed21103a0b8324cff6..2dc6356a02ebe2e5c0428cefc18e64882d85b4a6:/import.c diff --git a/import.c b/import.c index e7926511..ff438161 100644 --- a/import.c +++ b/import.c @@ -485,6 +485,8 @@ struct ssh2_userkey *openssh_read(char *filename, char *passphrase) char *modptr; int modlen; + blob = NULL; + if (!key) return NULL; @@ -1026,9 +1028,9 @@ struct sshcom_key *load_sshcom_key(char *filename) * Header lines can end in a trailing backslash for * continuation. */ - while ((len = strlen(p)) > sizeof(buffer) - (p-buffer) -1 || + while ((len = strlen(p)) > (int)(sizeof(buffer) - (p-buffer) -1) || p[len-1] != '\n' || p[len-2] == '\\') { - if (len > (p-buffer) + sizeof(buffer)-2) { + if (len > (int)((p-buffer) + sizeof(buffer)-2)) { errmsg = "Header line too long to deal with"; goto error; } @@ -1588,7 +1590,7 @@ int sshcom_write(char *filename, struct ssh2_userkey *key, char *passphrase) { int slen = 60; /* starts at 60 due to "Comment: " */ char *c = key->comment; - while (strlen(c) > slen) { + while ((int)strlen(c) > slen) { fprintf(fp, "%.*s\\\n", slen, c); c += slen; slen = 70; /* allow 70 chars on subsequent lines */