mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 01:02:24 +00:00
Institutional failure to memset() things pointed at rather than pointers.
Things should now be zeroed and memory not leaked. Spotted by Brant Thomsen. [originally from svn r6476]
This commit is contained in:
parent
d8b7de5435
commit
8a785bd34d
12
import.c
12
import.c
@ -444,7 +444,7 @@ static struct openssh_key *load_openssh_key(const Filename *filename,
|
|||||||
memset(ret->keyblob, 0, ret->keyblob_size);
|
memset(ret->keyblob, 0, ret->keyblob_size);
|
||||||
sfree(ret->keyblob);
|
sfree(ret->keyblob);
|
||||||
}
|
}
|
||||||
memset(&ret, 0, sizeof(ret));
|
memset(ret, 0, sizeof(*ret));
|
||||||
sfree(ret);
|
sfree(ret);
|
||||||
}
|
}
|
||||||
if (errmsg_p) *errmsg_p = errmsg;
|
if (errmsg_p) *errmsg_p = errmsg;
|
||||||
@ -461,7 +461,7 @@ int openssh_encrypted(const Filename *filename)
|
|||||||
ret = key->encrypted;
|
ret = key->encrypted;
|
||||||
memset(key->keyblob, 0, key->keyblob_size);
|
memset(key->keyblob, 0, key->keyblob_size);
|
||||||
sfree(key->keyblob);
|
sfree(key->keyblob);
|
||||||
memset(&key, 0, sizeof(key));
|
memset(key, 0, sizeof(*key));
|
||||||
sfree(key);
|
sfree(key);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -654,7 +654,7 @@ struct ssh2_userkey *openssh_read(const Filename *filename, char *passphrase,
|
|||||||
}
|
}
|
||||||
memset(key->keyblob, 0, key->keyblob_size);
|
memset(key->keyblob, 0, key->keyblob_size);
|
||||||
sfree(key->keyblob);
|
sfree(key->keyblob);
|
||||||
memset(&key, 0, sizeof(key));
|
memset(key, 0, sizeof(*key));
|
||||||
sfree(key);
|
sfree(key);
|
||||||
if (errmsg_p) *errmsg_p = errmsg;
|
if (errmsg_p) *errmsg_p = errmsg;
|
||||||
return retval;
|
return retval;
|
||||||
@ -1099,7 +1099,7 @@ static struct sshcom_key *load_sshcom_key(const Filename *filename,
|
|||||||
memset(ret->keyblob, 0, ret->keyblob_size);
|
memset(ret->keyblob, 0, ret->keyblob_size);
|
||||||
sfree(ret->keyblob);
|
sfree(ret->keyblob);
|
||||||
}
|
}
|
||||||
memset(&ret, 0, sizeof(ret));
|
memset(ret, 0, sizeof(*ret));
|
||||||
sfree(ret);
|
sfree(ret);
|
||||||
}
|
}
|
||||||
if (errmsg_p) *errmsg_p = errmsg;
|
if (errmsg_p) *errmsg_p = errmsg;
|
||||||
@ -1141,7 +1141,7 @@ int sshcom_encrypted(const Filename *filename, char **comment)
|
|||||||
*comment = dupstr(key->comment);
|
*comment = dupstr(key->comment);
|
||||||
memset(key->keyblob, 0, key->keyblob_size);
|
memset(key->keyblob, 0, key->keyblob_size);
|
||||||
sfree(key->keyblob);
|
sfree(key->keyblob);
|
||||||
memset(&key, 0, sizeof(key));
|
memset(key, 0, sizeof(*key));
|
||||||
sfree(key);
|
sfree(key);
|
||||||
return answer;
|
return answer;
|
||||||
}
|
}
|
||||||
@ -1416,7 +1416,7 @@ struct ssh2_userkey *sshcom_read(const Filename *filename, char *passphrase,
|
|||||||
}
|
}
|
||||||
memset(key->keyblob, 0, key->keyblob_size);
|
memset(key->keyblob, 0, key->keyblob_size);
|
||||||
sfree(key->keyblob);
|
sfree(key->keyblob);
|
||||||
memset(&key, 0, sizeof(key));
|
memset(key, 0, sizeof(*key));
|
||||||
sfree(key);
|
sfree(key);
|
||||||
if (errmsg_p) *errmsg_p = errmsg;
|
if (errmsg_p) *errmsg_p = errmsg;
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user