kex: Avoid NULL pointer dereference (GHSL-2023-032)

Thanks Phil Turnbull from Github

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Norbert Pocs <npocs@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Jakub Jelen
2023-03-06 12:10:50 +01:00
parent a94ac4c080
commit e8c959084f

View File

@@ -305,6 +305,10 @@ static int cmp_first_kex_algo(const char *client_str,
int is_wrong = 1;
if (client_str == NULL || server_str == NULL) {
return is_wrong;
}
colon = strchr(client_str, ',');
if (colon == NULL) {
client_kex_len = strlen(client_str);