mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-24 13:41:03 +03:00
kex: Avoid NULL pointer dereference (GHSL-2023-032)
Thanks Phil Turnbull from Github Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
543f3cba7d
commit
7ea71ead61
@@ -321,6 +321,10 @@ static int cmp_first_kex_algo(const char *client_str,
|
|||||||
|
|
||||||
int is_wrong = 1;
|
int is_wrong = 1;
|
||||||
|
|
||||||
|
if (client_str == NULL || server_str == NULL) {
|
||||||
|
return is_wrong;
|
||||||
|
}
|
||||||
|
|
||||||
colon = strchr(client_str, ',');
|
colon = strchr(client_str, ',');
|
||||||
if (colon == NULL) {
|
if (colon == NULL) {
|
||||||
client_kex_len = strlen(client_str);
|
client_kex_len = strlen(client_str);
|
||||||
|
|||||||
Reference in New Issue
Block a user