]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
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)
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.


No differences found