]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
ntp: initialize network correction of transmitted packets
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 2 Nov 2023 11:41:55 +0000 (12:41 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 2 Nov 2023 11:53:00 +0000 (12:53 +0100)
Initialize the unused value of network correction parsed from
own transmitted packets to avoid a use-of-uninitialized-value error
in NIO_UnwrapMessage() reported by clang.

Fixes: 6372a9f93f59 ("ntp: save PTP correction from NTP-over-PTP messages")
ntp_io_linux.c

index e797f34af6fe86d08b75a104e832889b4c5e5c24..3b6874e3391325f01ea9a8c773fd8fe018b12ed7 100644 (file)
@@ -727,7 +727,7 @@ NIO_Linux_ProcessMessage(SCK_Message *message, NTP_Local_Address *local_addr,
 {
   struct Interface *iface;
   int is_tx, ts_if_index, l2_length;
-  double c;
+  double c = 0.0;
 
   is_tx = event == SCH_FILE_EXCEPTION;
   iface = NULL;