tests: Initialize pointers

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Pavol Žáčik <pzacik@redhat.com>
Merge-Request: <https://gitlab.com/libssh/libssh-mirror/-/merge_requests/827>
This commit is contained in:
Jakub Jelen
2026-04-30 13:12:23 +02:00
parent a33da974ef
commit 8e82aabc21
2 changed files with 21 additions and 21 deletions

View File

@@ -536,9 +536,9 @@ static void free_test_server_state(void **state)
static int setup_kbdint_server(void **state)
{
struct torture_state *s;
struct server_state_st *ss;
struct test_server_st *tss;
struct torture_state *s = NULL;
struct server_state_st *ss = NULL;
struct test_server_st *tss = NULL;
char rsa_hostkey[1024] = {0};
@@ -638,9 +638,9 @@ static int setup_kbdint_server(void **state)
static int teardown_kbdint_server(void **state)
{
struct torture_state *s;
struct server_state_st *ss;
struct test_server_st *tss;
struct torture_state *s = NULL;
struct server_state_st *ss = NULL;
struct test_server_st *tss = NULL;
tss = *state;
assert_non_null(tss);
@@ -664,9 +664,9 @@ static int teardown_kbdint_server(void **state)
static int session_setup(void **state)
{
struct test_server_st *tss = *state;
struct torture_state *s;
struct torture_state *s = NULL;
int verbosity = torture_libssh_verbosity();
struct passwd *pwd;
struct passwd *pwd = NULL;
bool b = false;
int rc;
@@ -698,7 +698,7 @@ static int session_setup(void **state)
static int session_teardown(void **state)
{
struct test_server_st *tss = *state;
struct torture_state *s;
struct torture_state *s = NULL;
assert_non_null(tss);
@@ -714,8 +714,8 @@ static int session_teardown(void **state)
static void torture_server_auth_kbdint(void **state)
{
struct test_server_st *tss = *state;
struct torture_state *s;
ssh_session session;
struct torture_state *s = NULL;
ssh_session session = NULL;
int rc;
assert_non_null(tss);

View File

@@ -91,7 +91,7 @@ static const char *pattern = NULL;
/* TODO missing code coverage */
static int _torture_auth_kbdint(ssh_session session, const char *password)
{
const char *prompt;
const char *prompt = NULL;
char echo;
int err;
@@ -129,10 +129,10 @@ static int _torture_auth_kbdint(ssh_session session, const char *password)
int torture_rmdirs(const char *path)
{
DIR *d;
struct dirent *dp;
DIR *d = NULL;
struct dirent *dp = NULL;
struct stat sb;
char *fname;
char *fname = NULL;
if ((d = opendir(path)) != NULL) {
while (stat(path, &sb) == 0) {
@@ -301,7 +301,7 @@ ssh_session torture_ssh_session(struct torture_state *s,
const char *user,
const char *password)
{
ssh_session session;
ssh_session session = NULL;
int method;
int rc;
@@ -596,9 +596,9 @@ out:
struct torture_sftp *torture_sftp_session_channel(ssh_session session,
ssh_channel channel)
{
struct torture_sftp *t;
struct torture_sftp *t = NULL;
char template[] = "/tmp/ssh_torture_XXXXXX";
char *p;
char *p = NULL;
int rc;
if (session == NULL) {
@@ -744,8 +744,8 @@ const char *torture_server1_address(int family)
void torture_setup_socket_dir(void **state)
{
struct torture_state *s;
const char *p;
struct torture_state *s = NULL;
const char *p = NULL;
size_t len;
char *env = NULL;
char gss_dir[1024] = {0};
@@ -1264,7 +1264,7 @@ void torture_set_env_from_str(const char *env)
* */
void torture_setup_libssh_server(void **state, const char *server_path)
{
struct torture_state *s;
struct torture_state *s = NULL;
char start_cmd[1024];
char timeout_cmd[512];
char env[1024];