]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
keys: initialize data used for measuring authentication delay
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 20 Jun 2018 12:36:28 +0000 (14:36 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 20 Jun 2018 14:45:26 +0000 (16:45 +0200)
This issue was found in a Frama-C analysis.

keys.c

diff --git a/keys.c b/keys.c
index 74b57c4537195c0d5aa49345774fafda9adb5f61..61ffb91c64d4c9c88b29017e98c483f885f8ce9d 100644 (file)
--- a/keys.c
+++ b/keys.c
@@ -107,6 +107,8 @@ determine_hash_delay(uint32_t key_id)
   double diff, min_diff;
   int i, nsecs;
 
+  memset(&pkt, 0, sizeof (pkt));
+
   for (i = 0; i < 10; i++) {
     LCL_ReadRawTime(&before);
     KEY_GenerateAuth(key_id, (unsigned char *)&pkt, NTP_NORMAL_PACKET_LENGTH,