CVE-2025-4878 Initialize pointers where possible

This is mostly mechanical change initializing all the pointers I was able to
find with some grep and manual review of sources and examples.

Used the following greps (which yield some false positives though):

    git grep "    \w* *\* *\w*;$"
    git grep " ssh_session \w*;"
    git grep " ssh_channel \w*;"
    git grep " struct ssh_iterator \*\w*;"
    git grep " ssh_bind \w*;"
    git grep " ssh_key \w*;"
    git grep " ssh_string \w*;"
    git grep " ssh_buffer \w*;"
    git grep " HMACCTX \w*;"
    git grep " SHACTX \w*;"
    grep -rinP '^(?!.*=)\s*(?:\w+\s+)*\w+\s*\*\s*\w+\s*;'

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2025-04-23 17:57:11 +02:00
committed by Andreas Schneider
parent 5d27f69494
commit 2eb2af4426
62 changed files with 352 additions and 336 deletions

View File

@@ -195,8 +195,9 @@ static int ssh_userauth_get_response(ssh_session session)
*
* This banner should be shown to user prior to authentication
*/
SSH_PACKET_CALLBACK(ssh_packet_userauth_banner) {
ssh_string banner;
SSH_PACKET_CALLBACK(ssh_packet_userauth_banner)
{
ssh_string banner = NULL;
(void)type;
(void)user;
@@ -1783,7 +1784,7 @@ int ssh_userauth_agent_pubkey(ssh_session session,
const char *username,
ssh_public_key publickey)
{
ssh_key key;
ssh_key key = NULL;
int rc;
key = ssh_key_new();