Blame SOURCES/ntp-4.2.6p5-cve-2015-5219.patch

6e16f6
commit 5f295cd05c3c136d39f5b3e500a2d781bdbb59c8
6e16f6
Author:  <stenn@deacon.udel.edu>
6e16f6
Date:   Wed Apr 24 19:13:53 2013 -0400
6e16f6
6e16f6
    [Bug 2382] Implement LOGTOD using ldexp() instead of shifting
6e16f6
6e16f6
diff --git a/include/ntp.h b/include/ntp.h
6e16f6
index aa45e16..95b2542 100644
6e16f6
--- a/include/ntp.h
6e16f6
+++ b/include/ntp.h
6e16f6
@@ -156,10 +156,9 @@ typedef char s_char;
6e16f6
 #define SQUARE(x) ((x) * (x))
6e16f6
 #define SQRT(x) (sqrt(x))
6e16f6
 #define DIFF(x, y) (SQUARE((x) - (y)))
6e16f6
-#define LOGTOD(a)	((a) < 0 ? 1. / (1L << -(a)) : \
6e16f6
-			    1L << (int)(a)) /* log2 to double */
6e16f6
+#define LOGTOD(a)	ldexp(1., (int)(a)) /* log2 to double */
6e16f6
 #define UNIVAR(x)	(SQUARE(.28867513 * LOGTOD(x))) /* std uniform distr */
6e16f6
-#define ULOGTOD(a)	(1L << (int)(a)) /* ulog2 to double */
6e16f6
+#define ULOGTOD(a)	ldexp(1., (int)(a)) /* ulog2 to double */
6e16f6
 
6e16f6
 #define	EVENT_TIMEOUT	0	/* one second, that is */
6e16f6