SSH-01-006: Add missing NULL checks in pki_signature_from_rsa_blob()

Fixes T193

Signed-off-by: Andreas Schneider <asn@cryptomilk.org
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
(cherry picked from commit 7b9cbcebe5)
This commit is contained in:
Andreas Schneider
2019-10-28 14:26:27 +01:00
parent 2b52a8df4d
commit 053a23b50d

View File

@@ -1614,6 +1614,10 @@ static int pki_signature_from_rsa_blob(const ssh_key pubkey,
blob_padded_data = (char *) ssh_string_data(sig_blob_padded);
blob_orig = (char *) ssh_string_data(sig_blob);
if (blob_padded_data == NULL || blob_orig == NULL) {
goto errout;
}
/* front-pad the buffer with zeroes */
explicit_bzero(blob_padded_data, pad_len);
/* fill the rest with the actual signature blob */