diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2020-07-16 12:06:41 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2020-07-16 12:06:46 +0200 |
commit | 39d85eddc0d485b3172ddd8fe3f78deb351418ac (patch) | |
tree | 9fdad38dcd6b96ef4e35d4fc15195ac0bb82e80b | |
parent | dc8c0c1cba6b5049c9cc6ede55926d4e104c631a (diff) | |
download | libssh-39d85eddc0d485b3172ddd8fe3f78deb351418ac.tar.gz libssh-39d85eddc0d485b3172ddd8fe3f78deb351418ac.tar.xz libssh-39d85eddc0d485b3172ddd8fe3f78deb351418ac.zip |
SQREVIEW
-rw-r--r-- | tests/client/torture_session.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/client/torture_session.c b/tests/client/torture_session.c index d397cb16..72b956dd 100644 --- a/tests/client/torture_session.c +++ b/tests/client/torture_session.c @@ -177,16 +177,16 @@ static void torture_max_sessions(void **state) { struct torture_state *s = *state; ssh_session session = s->ssh.session; - ssh_channel channels[11]; - +#define MAX_CHANNELS 10 + ssh_channel channels[MAX_CHANNELS + 1]; + size_t i; int rc; - int i; /* Update server configuration to limit number of sessions */ torture_update_sshd_config(state, "MaxSessions 10"); /* Open the maximum number of channel sessions */ - for (i = 0; i < 10; i++) { + for (i = 0; i < MAX_CHANNELS; i++) { channels[i] = ssh_channel_new(session); assert_non_null(channels[i]); @@ -205,10 +205,11 @@ static void torture_max_sessions(void **state) ssh_channel_free(channels[i]); /* Close and free channels */ - for (i = 0; i < 10; i++) { + for (i = 0; i < MAX_CHANNELS; i++) { ssh_channel_close(channels[i]); ssh_channel_free(channels[i]); } +#undef MAX_CHANNELS } int torture_run_tests(void) { |