Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [day] [month] [year] [list]
Date: Fri, 11 Aug 2017 22:55:22 -0400
From: Daniel Sabogal <dsabogalcc@...il.com>
To: musl@...ts.openwall.com
Subject: [PATCH] fix signed overflow in ftok

---
 src/ipc/ftok.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ipc/ftok.c b/src/ipc/ftok.c
index cd6002ed..c36b4b60 100644
--- a/src/ipc/ftok.c
+++ b/src/ipc/ftok.c
@@ -6,5 +6,5 @@ key_t ftok(const char *path, int id)
 	struct stat st;
 	if (stat(path, &st) < 0) return -1;
 
-	return ((st.st_ino & 0xffff) | ((st.st_dev & 0xff) << 16) | ((id & 0xff) << 24));
+	return ((st.st_ino & 0xffff) | ((st.st_dev & 0xff) << 16) | ((id & 0xffu) << 24));
 }
-- 
2.14.0

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ