[hackers] [slstatus][PATCH] ram: fixed int overflow on pagetok macro

From: Tobias Tschinkowitz <he4d_AT_posteo.de>
Date: Thu, 24 May 2018 12:09:26 +0200

---
 components/ram.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/components/ram.c b/components/ram.c
index 0ac9753..0333b3b 100644
--- a/components/ram.c
+++ b/components/ram.c
_AT_@ -75,7 +75,7 @@
 	#include <unistd.h>
 
 	#define LOG1024 	10
-	#define pagetok(size, pageshift) ((size) << (pageshift - LOG1024))
+	#define pagetok(size, pageshift) (size_t)(size << (pageshift - LOG1024))
 
 	inline int
 	load_uvmexp(struct uvmexp *uvmexp)
-- 
2.16.2
Received on Thu May 24 2018 - 12:09:26 CEST

This archive was generated by hypermail 2.3.0 : Thu May 24 2018 - 12:12:25 CEST