From 39d85eddc0d485b3172ddd8fe3f78deb351418ac Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 16 Jul 2020 12:06:41 +0200 Subject: SQ --- tests/client/torture_session.c | 11 ++++++----- 1 file 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) { -- cgit v1.2.3