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

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