]> asedeno.scripts.mit.edu Git - PuTTY.git/commit
Const-correctness of name fields in struct ssh_*.
authorSimon Tatham <anakin@pobox.com>
Fri, 15 May 2015 09:12:06 +0000 (10:12 +0100)
committerSimon Tatham <anakin@pobox.com>
Fri, 15 May 2015 09:12:06 +0000 (10:12 +0100)
commita5fc95b715256a7db4492ccf6872788613f105c4
tree40d7ca10b38eccaa14217133fe25b3556ff613dc
parent79fe96155a9486a58c1ce588069975346b4f4a22
Const-correctness of name fields in struct ssh_*.

All the name strings in ssh_cipher, ssh_mac, ssh_hash, ssh_signkey
point to compile-time string literals, hence should obviously be const
char *.

Most of these const-correctness patches are just a mechanical job of
adding a 'const' in the one place you need it right now, and then
chasing the implications through the code adding further consts until
it compiles. But this one has actually shown up a bug: the 'algorithm'
output parameter in ssh2_userkey_loadpub was sometimes returning a
pointer to a string literal, and sometimes a pointer to dynamically
allocated memory, so callers were forced to either sometimes leak
memory or sometimes free a bad thing. Now it's consistently
dynamically allocated, and should be freed everywhere too.
cmdgen.c
macosx/osxdlg.m
putty.h
ssh.c
ssh.h
sshpubk.c
unix/gtkdlg.c
unix/uxcons.c
windows/wincons.c
windows/windlg.c