]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
util: add assertion for NTP timestamp size
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 15 Aug 2017 08:51:44 +0000 (10:51 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 15 Aug 2017 11:27:50 +0000 (13:27 +0200)
util.c

diff --git a/util.c b/util.c
index 2f4df156e9639299a1e97ebe96ec15f708f4edef..6803c02844cb8461cdbc7eedaaebcb41bf85b1d8 100644 (file)
--- a/util.c
+++ b/util.c
@@ -641,6 +641,7 @@ UTI_GetNtp64Fuzz(NTP_int64 *ts, int precision)
   int start, bits;
 
   assert(precision >= -32 && precision <= 32);
+  assert(sizeof (*ts) == 8);
 
   start = sizeof (*ts) - (precision + 32 + 7) / 8;
   ts->hi = ts->lo = 0;