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

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