mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 10:40:27 +09:00
Add safety checks for all ssh_string_fill calls
These calls can fail and the return code should always be checked. These issues were identified when code review called it out on new code. The updates here are to existing code with no behavior changes to make review simpler. Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
f6a2f6190c
commit
daeee74edd
@@ -68,7 +68,9 @@ static void torture_session_keys(UNUSED_PARAM(void **state))
|
||||
int rc;
|
||||
|
||||
k_string = ssh_string_new(32);
|
||||
ssh_string_fill(k_string, key, 32);
|
||||
rc = ssh_string_fill(k_string, key, 32);
|
||||
assert_int_equal(rc, 0);
|
||||
|
||||
test_crypto.shared_secret = ssh_make_string_bn(k_string);
|
||||
|
||||
rc = ssh_generate_session_keys(&session);
|
||||
|
||||
Reference in New Issue
Block a user