From 0c92b3908341f41b2202d04efe5fd46f1462dbe3 Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Thu, 19 Oct 2023 11:14:23 +0200 Subject: check_dbi: Fix compiler warning for uninitialized variable diff --git a/plugins/check_dbi.c b/plugins/check_dbi.c index c24ca24..29c8520 100644 --- a/plugins/check_dbi.c +++ b/plugins/check_dbi.c @@ -141,7 +141,7 @@ main (int argc, char **argv) if (verbose > 2) printf ("Initializing DBI\n"); - dbi_inst *instance_p; + dbi_inst *instance_p = { 0 }; if (dbi_initialize_r(NULL, instance_p) < 0) { printf ("UNKNOWN - failed to initialize DBI; possibly you don't have any drivers installed.\n"); -- cgit v0.10-9-g596f From 0ab5e10d9b78af6e94a06ab990f0e16b24972c0d Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Thu, 19 Oct 2023 11:55:11 +0200 Subject: check_curl: Initialize pointer before usage diff --git a/plugins/check_curl.c b/plugins/check_curl.c index 153e492..c59fa7e 100644 --- a/plugins/check_curl.c +++ b/plugins/check_curl.c @@ -395,7 +395,7 @@ lookup_host (const char *host, char *buf, size_t buflen) char addrstr[100]; size_t addrstr_len; int errcode; - void *ptr; + void *ptr = { 0 }; size_t buflen_remaining = buflen - 1; memset (&hints, 0, sizeof (hints)); -- cgit v0.10-9-g596f From 7ba8463506b3d246c246a0caa0d78f0d16b321c6 Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Thu, 19 Oct 2023 11:59:43 +0200 Subject: check_ntp: Initialize intermediate results in any case diff --git a/plugins/check_ntp_peer.c b/plugins/check_ntp_peer.c index d4e5fd9..4fb9018 100644 --- a/plugins/check_ntp_peer.c +++ b/plugins/check_ntp_peer.c @@ -557,7 +557,8 @@ char *perfd_truechimers (int num_truechimers) } int main(int argc, char *argv[]){ - int result, offset_result, stratum, num_truechimers, oresult, jresult, sresult, tresult; + int result, offset_result, stratum, num_truechimers; + int oresult, jresult, sresult, tresult = STATE_UNKNOWN; double offset=0, jitter=0; char *result_line, *perfdata_line; -- cgit v0.10-9-g596f