mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-07 10:40:28 +09:00
bignum: Make sure the padding is large enough for the number
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Sahana Prasad <sahana@redhat.com>
This commit is contained in:
@@ -40,7 +40,10 @@ static ssh_string make_bignum_string(bignum num, size_t pad_to_len)
|
||||
pad++;
|
||||
}
|
||||
} else {
|
||||
pad = pad_to_len - bignum_num_bytes(num);
|
||||
if (len > pad_to_len) {
|
||||
return NULL;
|
||||
}
|
||||
pad = pad_to_len - len;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_CRYPTO
|
||||
|
||||
Reference in New Issue
Block a user