simon-git: putty (master): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Sat Jul 6 18:16:42 BST 2019
TL;DR:
e2a047ad Fix assorted memory leaks.
93f80836 cmdgen: add const on main() variable 'comment'.
e0b811cc ssh2userauth: fix sense of test for change_username!
d7f254fd Fix a more complicated memory leak.
Repository: https://git.tartarus.org/simon/putty.git
On the web: https://git.tartarus.org/?p=simon/putty.git
Branch updated: master
Committer: Simon Tatham <anakin at pobox.com>
Date: 2019-07-06 18:16:42
commit e2a047ad8de0268141ff01ca303bc81a9befca6b
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=e2a047ad8de0268141ff01ca303bc81a9befca6b;hp=11f504c440d13da6cc95dcfeaa788fa28cd361bf
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Jul 6 17:44:15 2019 +0100
Fix assorted memory leaks.
Affects command-line PuTTYgen, PSFTP, and anything running the SSH-2
userauth client layer.
Tweaked version of a patch due to Tim Kosse.
cmdgen.c | 11 +++++++++++
psftp.c | 12 +++++++++---
ssh2userauth.c | 4 ++++
3 files changed, 24 insertions(+), 3 deletions(-)
commit 93f80836b4de9489a762ba138714721a70ec699e
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=93f80836b4de9489a762ba138714721a70ec699e;hp=e2a047ad8de0268141ff01ca303bc81a9befca6b
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Jul 6 17:54:56 2019 +0100
cmdgen: add const on main() variable 'comment'.
It's a secondary reference to existing data (namely an argv word, if
anything at all), and never needs to be written through, so we should
mark it const, if nothing else to catch any absent-minded attempts to
free it.
cmdgen.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
commit e0b811cc1f3b5ec5d8cb6868afac9a26da4221c5
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=e0b811cc1f3b5ec5d8cb6868afac9a26da4221c5;hp=93f80836b4de9489a762ba138714721a70ec699e
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Jul 6 18:05:54 2019 +0100
ssh2userauth: fix sense of test for change_username!
How embarrassing: we were looping back round to prompt for a username
again if s->change_username was *true*, but then the test at the top
would only have reissued the prompt if it was *false*. So that
configuration checkbox must have been broken for ages. It's a good job
most SSH servers don't reward enabling it!
ssh2userauth.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit d7f254fdb03ad004acab7c3e5f1c2eb9fcef0ead
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=d7f254fdb03ad004acab7c3e5f1c2eb9fcef0ead;hp=e0b811cc1f3b5ec5d8cb6868afac9a26da4221c5
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Jul 6 18:06:04 2019 +0100
Fix a more complicated memory leak.
The field s->username in the ssh2userauth state was sometimes a
secondary reference to s->default_username, and sometimes a
dynamically allocated string. So not freeing it can leak memory, but
freeing it (if non-null) can cause a double-free crash.
Solution: add a new field s->locally_allocated_username which is the
thing that needs freeing (if any), and make s->username into a const
char * which is always a secondary reference to _something_.
ssh2userauth.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
More information about the tartarus-commits
mailing list