CVE-2025-4878 legacy: Properly check return value to avoid NULL pointer dereference

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2025-04-28 11:04:55 +02:00
committed by Andreas Schneider
parent 697650caa9
commit b35ee876ad

View File

@@ -441,7 +441,7 @@ ssh_private_key privatekey_from_file(ssh_session session,
auth_fn,
auth_data,
&key);
if (rc == SSH_ERROR) {
if (rc != SSH_OK) {
return NULL;
}